mg-ocr-invoice 0.4.0 → 0.4.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mg-ocr-invoice",
3
3
  "private": false,
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "type": "module",
6
6
  "types": "dist/types/index.d.ts",
7
7
  "module": "dist/index.es.js",
@@ -201,6 +201,7 @@ import {
201
201
  VerificationOfTruth,
202
202
  } from './const'
203
203
  import Cookies from 'js-cookie'
204
+ import { onUnmounted } from 'vue'
204
205
  const emit = defineEmits(['edit', 'ok'])
205
206
  const $props = defineProps({
206
207
  listId: {
@@ -248,7 +249,7 @@ const getList = async () => {
248
249
  // 保持选择状态
249
250
  return {
250
251
  ...item,
251
- selected: data.selected
252
+ selected: data.selected,
252
253
  // ...Object.assign(data, item),
253
254
  }
254
255
  })
@@ -437,9 +438,9 @@ const ok = () => {
437
438
  const filterTitleErr = selectData.some(
438
439
  (item) => item.invoiceCompanyType === '异常抬头'
439
440
  )
440
- console.log(filterTitleErr,'filterTitleErr')
441
+ console.log(filterTitleErr, 'filterTitleErr')
441
442
  if (filterTitleErr) {
442
- console.log(Cookies.get('teleport'),'teleport')
443
+ console.log(Cookies.get('teleport'), 'teleport')
443
444
  showConfirmDialog({
444
445
  title: '提醒',
445
446
  message: '存在异常抬头发票,请确认是否继续提交?',
@@ -453,11 +454,12 @@ const ok = () => {
453
454
  .catch((error) => {
454
455
  console.log(error)
455
456
  })
456
- return
457
+ return
457
458
  }
458
459
  emit('ok', selectData, batchId.value)
459
460
  }
460
461
  const timeID: any = ref(null)
462
+ const timeID2: any = ref(null)
461
463
  const setTimeGetList = () => {
462
464
  getList()
463
465
  .then((res: any) => {
@@ -466,17 +468,23 @@ const setTimeGetList = () => {
466
468
  item.taskStatus === 'ocr_doing' || item.taskStatus === 'ocr_success'
467
469
  )
468
470
  if (!flag) {
471
+ clearTimeout(timeID.value)
472
+ clearTimeout(timeID2.value)
469
473
  return
470
474
  }
471
- setTimeout(setTimeGetList, 2000)
475
+ timeID.value = setTimeout(setTimeGetList, 2000)
472
476
  })
473
477
  .catch((err) => {
474
- setTimeout(setTimeGetList, 2000)
478
+ timeID2.value = setTimeout(setTimeGetList, 2000)
475
479
  })
476
480
  }
477
481
  onMounted(() => {
478
482
  setTimeGetList()
479
483
  })
484
+ onUnmounted(() => {
485
+ clearTimeout(timeID.value)
486
+ clearTimeout(timeID2.value)
487
+ })
480
488
  </script>
481
489
  <style lang="scss" scoped>
482
490
  .disabledColor {