mg-ocr-invoice 0.2.4-beta0.1 → 0.2.4-beta0.6

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.2.4-beta0.1",
4
+ "version": "0.2.4-beta0.6",
5
5
  "type": "module",
6
6
  "types": "dist/types/index.d.ts",
7
7
  "module": "dist/index.es.js",
@@ -12,7 +12,7 @@
12
12
  <template #title>
13
13
  <div class="Field-title">
14
14
  <span class="titleLeft">公司信息</span>
15
- <span class="titleright">重新查验</span>
15
+ <!-- <span class="titleright">重新查验</span> -->
16
16
  </div>
17
17
  </template>
18
18
  <div class="marPX">
@@ -121,7 +121,15 @@
121
121
  <div class="marPX">
122
122
  <Cell title="价税合计" :value="computed_amount">
123
123
  <template #value>
124
- <div style="color: #333;font-weight: 400; font-size: 16px;margin-right: 12px;">{{ computed_amount }}</div>
124
+ <div
125
+ style="
126
+ color: #333;
127
+ font-weight: 400;
128
+ font-size: 16px;
129
+ margin-right: 12px;
130
+ ">
131
+ {{ computed_amount }}
132
+ </div>
125
133
  </template>
126
134
  <template #right-icon>
127
135
  <div @click="expandObj.showPrice = !expandObj.showPrice">
@@ -211,11 +219,11 @@
211
219
  </CellGroup>
212
220
  <div class="submit">
213
221
  <span
214
- style="width: 30%; background-color: #07c160; color: #fff"
222
+ style="flex: 1; background-color: #07c160; color: #fff"
215
223
  @click="close">
216
224
  返回
217
225
  </span>
218
- <span @click="submit">保存</span>
226
+ <span v-if="isEdit" @click="submit">保存</span>
219
227
  </div>
220
228
  </Form>
221
229
  </div>
@@ -317,7 +325,15 @@ const close = () => {
317
325
  const openPreViewImg = () => {
318
326
  showImagePreview([props.invoiceData.attachmentLink])
319
327
  }
320
-
328
+ const isEdit = computed(() => {
329
+ // true 允许
330
+ return (
331
+ props.invoiceData.realStatus === 'noNeed' ||
332
+ props.invoiceData.invoiceExceptionInfo === 'abnormal' ||
333
+ props.invoiceData.manualModify ||
334
+ props.invoiceData.rerealStatus === 'checkFail'
335
+ )
336
+ })
321
337
  const submit = async () => {
322
338
  showLoading.value = true
323
339
  try {
@@ -392,7 +408,12 @@ const blurInput = (e: any, key: any) => {
392
408
  const computed_amount = computed(() => {
393
409
  let count = new Decimal(0)
394
410
  formData.value.itemAmountReqs.forEach((item) => {
395
- count = count.plus(new Decimal(item.itemExTaxAmount))
411
+ let tax_amount = new Decimal(filterNumber(item.itemExTaxAmount)).times(
412
+ new Decimal(filterNumber(item.itemTaxRate / 100))
413
+ )
414
+ count = count.plus(
415
+ new Decimal(filterNumber(item.itemExTaxAmount)).plus(tax_amount)
416
+ )
396
417
  })
397
418
  return count.toFixed(2)
398
419
  })
@@ -525,9 +546,11 @@ onMounted(() => {
525
546
  padding: 0 12px;
526
547
  z-index: 2;
527
548
  background-color: #fff;
549
+ gap: 12px;
528
550
  span {
551
+ flex: 2;
529
552
  background-color: #266fe8;
530
- width: 68%;
553
+ // width: 68%;
531
554
  font-size: 15px;
532
555
  color: #fff;
533
556
  height: 44px;
@@ -251,19 +251,11 @@ const getList = async () => {
251
251
  const clickItem = (row: any) => {
252
252
  row.selected = !row.selected
253
253
  }
254
- const isEdit = (row: any) => {
255
- // true 允许
256
- return (
257
- row.realStatus === 'noNeed' ||
258
- row.invoiceExceptionInfo === 'abnormal' ||
259
- row.manualModify ||
260
- row.rerealStatus === 'checkFail'
261
- )
262
- }
254
+
263
255
  const openDetails = (row: any) => {
264
- if (!isEdit(row)) {
265
- return
266
- }
256
+ // if (!isEdit(row)) {
257
+ // return
258
+ // }
267
259
  emit(
268
260
  'edit',
269
261
  {
@@ -275,18 +267,17 @@ const openDetails = (row: any) => {
275
267
  )
276
268
  }
277
269
  const selectStatus = (item: any) => {
278
- console.log(item)
279
270
  // 未使用&& (验真通过||无需验真|| 手工录入||验真异常) && 发票推断状态错误值为空 && 发票识别任务已完成
280
271
  return (
281
272
  item.invoiceStatus === 'unused' &&
282
273
  (item.realStatus === 'checked' ||
283
274
  item.realStatus === 'noNeed' ||
284
275
  item.manualModify ||
285
- item.realStatus === 'checkFail' ||
286
- !item.invoiceExceptionInfo) &&
276
+ item.realStatus === 'checkFail') &&
287
277
  (item.taskStatus === 'ocr_success' ||
288
278
  item.taskStatus === 'repeat' ||
289
- item.taskStatus === 'finish')
279
+ item.taskStatus === 'finish') &&
280
+ !item.invoiceExceptionInfo
290
281
  )
291
282
  }
292
283
  const selectedAll: any = ref(false)