mg-ocr-invoice 0.4.2 → 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.
@@ -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 };
@@ -1,3 +1,2 @@
1
1
  import './styles/mu-invoice.css';
2
- import 'element-plus/dist/index.css';
3
- import 'vant/lib/index.css';
2
+ import './styles/vantimpCss';
@@ -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.2",
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": "^1.4.2"
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
- showFailToast(err.msg)
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(new Decimal(filterNumber(activeRow.value.itemExTaxAmount)).times(new Decimal(filterNumber(activeRow.value.itemTaxRate / 100))).toFixed(2))
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(new Decimal(item.itemTaxAmount))
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)">
@@ -64,9 +58,6 @@
64
58
  <span :class="setClass(item.invoiceStatus)">{{
65
59
  const_invoiceStatus[item.invoiceStatus]
66
60
  }}</span>
67
- <!-- <span class="error">识别失败</span>
68
- <span class="default">已使用</span>
69
- <span class="success">识别成功</span> -->
70
61
  </div>
71
62
  <div class="InvoiceInfo">
72
63
  <div class="leftinfo">
@@ -158,6 +149,7 @@
158
149
  </div>
159
150
  </div>
160
151
  <Popup
152
+ :z-index="9527"
161
153
  v-model:show="showPopup"
162
154
  :teleport="Cookies.get('teleport') || null"
163
155
  position="bottom"
@@ -171,6 +163,7 @@
171
163
  </div>
172
164
  </Popup>
173
165
  <Overlay
166
+ :z-index="9527"
174
167
  style="display: flex; justify-content: center; align-items: center"
175
168
  :show="showLoading">
176
169
  <Loading class="loading" color="#0094ff">上传中...</Loading>
@@ -204,6 +197,7 @@ import {
204
197
  } from './const'
205
198
  import Cookies from 'js-cookie'
206
199
  import { onUnmounted } from 'vue'
200
+
207
201
  const emit = defineEmits(['edit', 'ok'])
208
202
  const $props = defineProps({
209
203
  listId: {
@@ -271,12 +265,21 @@ const getList = async () => {
271
265
  })
272
266
  }
273
267
  const clickItem = (row: any) => {
274
- console.log(row.invoiceStatus)
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
+ }
275
277
  if (row.invoiceStatus !== 'unused') {
276
278
  return showToast({
277
279
  type: 'text',
278
280
  teleport: Cookies.get('teleport') || null,
279
281
  message: '发票已被使用!',
282
+ zIndex: 9527,
280
283
  })
281
284
  }
282
285
  row.selected = !row.selected
@@ -315,8 +318,9 @@ const changeSelectAll = (v: any) => {
315
318
  if (selectedAll.value) {
316
319
  showToast({
317
320
  type: 'text',
318
- message: '存在已使用或异常发票, 已自动过滤',
321
+ message: '已选择全部可用发票',
319
322
  teleport: Cookies.get('teleport') || null,
323
+ zIndex: 9527,
320
324
  })
321
325
  }
322
326
  list.value.forEach((item: any) => {
@@ -335,6 +339,7 @@ const deleteSelectItem = () => {
335
339
  type: 'text',
336
340
  message: '请先选择发票',
337
341
  teleport: Cookies.get('teleport') || null,
342
+ zIndex: 9527,
338
343
  })
339
344
  return
340
345
  }
@@ -342,6 +347,8 @@ const deleteSelectItem = () => {
342
347
  title: '提醒',
343
348
  message: '请确认是否需要移除选中项,移除后不可恢复!',
344
349
  teleport: Cookies.get('teleport') || null,
350
+ className: 'OCR-Zindex-OCR',
351
+ overlayClass: 'OCR-Zindex-OCR',
345
352
  })
346
353
  .then(async () => {
347
354
  var urlencoded = new URLSearchParams()
@@ -354,6 +361,7 @@ const deleteSelectItem = () => {
354
361
  type: 'success',
355
362
  message: '移除成功',
356
363
  teleport: Cookies.get('teleport') || null,
364
+ zIndex: 9527,
357
365
  })
358
366
  getList()
359
367
  }
@@ -385,6 +393,7 @@ const selectImg = async (type: number) => {
385
393
  type: 'success',
386
394
  message: '上传成功',
387
395
  teleport: Cookies.get('teleport') || null,
396
+ zIndex: 9527,
388
397
  })
389
398
  setTimeGetList()
390
399
  }
@@ -418,6 +427,7 @@ const ok = () => {
418
427
  type: 'text',
419
428
  message: '请先选择发票',
420
429
  teleport: Cookies.get('teleport') || null,
430
+ zIndex: 9527,
421
431
  })
422
432
  return
423
433
  }
@@ -426,6 +436,7 @@ const ok = () => {
426
436
  type: 'text',
427
437
  message: '发票无效或已被使用,请进行确认',
428
438
  teleport: Cookies.get('teleport') || null,
439
+ zIndex: 9527,
429
440
  })
430
441
  return
431
442
  }
@@ -451,6 +462,8 @@ const ok = () => {
451
462
  teleport: Cookies.get('teleport') || null,
452
463
  cancelButtonText: '返回修改',
453
464
  confirmButtonText: '继续提交',
465
+ className: 'OCR-Zindex-OCR',
466
+ overlayClass: 'OCR-Zindex-OCR',
454
467
  })
455
468
  .then(() => {
456
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, showFailToast } from 'vant'
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
- showFailToast(err.msg)
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
  }
@@ -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 }