mg-ocr-invoice 0.2.3 → 0.2.4-beta0.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/dist/index.es.js +10239 -9909
- package/dist/index.umd.js +39 -45
- package/dist/style.css +1 -1
- package/dist/types/api/invoice.d.ts +1 -0
- package/dist/types/components/Invoice/const.d.ts +4 -0
- package/dist/types/components/Invoice/index.vue.d.ts +11 -20
- package/dist/types/components/Invoice copy/index.vue.d.ts +23 -0
- package/dist/types/components/InvoiceList/const.d.ts +3 -1
- package/dist/types/components/InvoiceList/index.vue.d.ts +5 -7
- package/dist/types/components/OCRInvoice/const.d.ts +66 -0
- package/dist/types/utils/number.d.ts +1 -0
- package/package.json +2 -1
- package/src/components/Invoice/const.ts +4 -0
- package/src/components/Invoice/index.vue +422 -224
- package/src/components/Invoice copy/index.vue +343 -0
- package/src/components/InvoiceList/const.ts +13 -2
- package/src/components/InvoiceList/index.vue +97 -47
- package/src/components/OCRInvoice/const.ts +70 -0
- package/src/components/OCRInvoice/index.vue +8 -1
- package/src/components/PaymentMode/index.vue +0 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="Invoice">
|
|
3
|
+
<div class="top" @click="openPreViewImg">
|
|
4
|
+
<img :src="invoiceData.attachmentLink" alt="" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="company">
|
|
7
|
+
<div class="title"><i></i> <span>公司</span></div>
|
|
8
|
+
<div class="cardText">
|
|
9
|
+
<p style="font-size: 13px; color: #888888">销售方</p>
|
|
10
|
+
<div class="card">
|
|
11
|
+
<div class="companyName">{{ invoiceData.sellerName }}</div>
|
|
12
|
+
<div class="sellerInformation">
|
|
13
|
+
<ul>
|
|
14
|
+
<li>
|
|
15
|
+
<i></i>
|
|
16
|
+
<span class="label"> 纳税人识别号:</span>
|
|
17
|
+
<span class="value">{{ invoiceData.sellerId }}</span>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<i></i>
|
|
21
|
+
<span class="label">地址、电话:</span>
|
|
22
|
+
<span class="value">{{ invoiceData.sellerContact }}</span>
|
|
23
|
+
</li>
|
|
24
|
+
<li>
|
|
25
|
+
<i></i>
|
|
26
|
+
<span class="label">开户银行及账户:</span>
|
|
27
|
+
<span class="value">{{ invoiceData.sellerAccount }}</span>
|
|
28
|
+
</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="purchaser">
|
|
35
|
+
<ul>
|
|
36
|
+
<li>
|
|
37
|
+
<div class="label">购买方:</div>
|
|
38
|
+
<div class="input">{{ invoiceData.payerName }}</div>
|
|
39
|
+
</li>
|
|
40
|
+
<li>
|
|
41
|
+
<div class="label">发票类型:</div>
|
|
42
|
+
<div class="input">{{ invoiceData.description }}</div>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<div class="label">费用类型:</div>
|
|
46
|
+
<div class="input">其他费</div>
|
|
47
|
+
</li>
|
|
48
|
+
<li>
|
|
49
|
+
<div class="label">票面金额:</div>
|
|
50
|
+
<div class="input">
|
|
51
|
+
{{
|
|
52
|
+
invoiceData.priceTaxTotalFigure || invoiceData.noTaxAmountTotal
|
|
53
|
+
}}
|
|
54
|
+
</div>
|
|
55
|
+
</li>
|
|
56
|
+
<li>
|
|
57
|
+
<div class="label">发票代码:</div>
|
|
58
|
+
<div class="input">
|
|
59
|
+
<ElInputNumber
|
|
60
|
+
:min="0"
|
|
61
|
+
:controls="false"
|
|
62
|
+
@input="editFlag = true"
|
|
63
|
+
v-model.trim="invoiceData.invoiceCode"></ElInputNumber>
|
|
64
|
+
</div>
|
|
65
|
+
</li>
|
|
66
|
+
<li>
|
|
67
|
+
<div class="label">
|
|
68
|
+
<span class="van-field__label--required"></span>发票号码:
|
|
69
|
+
</div>
|
|
70
|
+
<div class="input">
|
|
71
|
+
<ElInputNumber
|
|
72
|
+
:min="0"
|
|
73
|
+
:controls="false"
|
|
74
|
+
@input="editFlag = true"
|
|
75
|
+
v-model.trim="invoiceData.invoiceNum"></ElInputNumber>
|
|
76
|
+
<!-- <input type="text" v-model.trim="invoiceData.invoiceNum" /> -->
|
|
77
|
+
<div v-if="showRequiredMsg" class="errColor">
|
|
78
|
+
发票号码不能为空!
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</li>
|
|
82
|
+
<li>
|
|
83
|
+
<div class="label">校验码:</div>
|
|
84
|
+
<div class="input">{{ invoiceData.checkCode }}</div>
|
|
85
|
+
</li>
|
|
86
|
+
<li>
|
|
87
|
+
<div class="label">开票日期:</div>
|
|
88
|
+
<div class="input">{{ invoiceData.invoiceDate }}</div>
|
|
89
|
+
</li>
|
|
90
|
+
</ul>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="submit">
|
|
94
|
+
<span
|
|
95
|
+
style="width: 30%; background-color: #07c160; color: #fff"
|
|
96
|
+
@click="close"
|
|
97
|
+
>返回</span
|
|
98
|
+
>
|
|
99
|
+
<span @click="submit">保存</span>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<Overlay
|
|
103
|
+
style="
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
align-items: center;
|
|
107
|
+
z-index: 999;
|
|
108
|
+
"
|
|
109
|
+
:show="showLoading">
|
|
110
|
+
<Loading class="loading" color="#0094ff">保存中...</Loading>
|
|
111
|
+
</Overlay>
|
|
112
|
+
</template>
|
|
113
|
+
<script setup lang="ts">
|
|
114
|
+
import { ref } from 'vue'
|
|
115
|
+
import '@/utils/disableZoom'
|
|
116
|
+
import { __updateInvoice } from '@/api/invoice'
|
|
117
|
+
import {
|
|
118
|
+
showToast,
|
|
119
|
+
Overlay,
|
|
120
|
+
Loading,
|
|
121
|
+
showFailToast,
|
|
122
|
+
showImagePreview,
|
|
123
|
+
} from 'vant'
|
|
124
|
+
import { ElInputNumber } from 'element-plus'
|
|
125
|
+
const { ids, invoiceData } = defineProps({
|
|
126
|
+
ids: {
|
|
127
|
+
type: Object,
|
|
128
|
+
required: true,
|
|
129
|
+
},
|
|
130
|
+
invoiceData: {
|
|
131
|
+
type: Object,
|
|
132
|
+
required: true,
|
|
133
|
+
},
|
|
134
|
+
})
|
|
135
|
+
const emit = defineEmits(['saveSuccess'])
|
|
136
|
+
document.title = '发票信息'
|
|
137
|
+
const showRequiredMsg = ref(false)
|
|
138
|
+
// const modules = ref([Pagination])
|
|
139
|
+
const showLoading = ref(false)
|
|
140
|
+
const close = () => {
|
|
141
|
+
emit('saveSuccess')
|
|
142
|
+
}
|
|
143
|
+
const openPreViewImg = () => {
|
|
144
|
+
showImagePreview([invoiceData.attachmentLink])
|
|
145
|
+
}
|
|
146
|
+
const editFlag = ref(false)
|
|
147
|
+
const submit = async () => {
|
|
148
|
+
if (!editFlag.value) {
|
|
149
|
+
emit('saveSuccess')
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
if (!invoiceData.invoiceNum) {
|
|
153
|
+
showRequiredMsg.value = true
|
|
154
|
+
return
|
|
155
|
+
} else {
|
|
156
|
+
showRequiredMsg.value = false
|
|
157
|
+
}
|
|
158
|
+
showLoading.value = true
|
|
159
|
+
try {
|
|
160
|
+
const res: any = await __updateInvoice({
|
|
161
|
+
...ids,
|
|
162
|
+
invoiceNum: invoiceData.invoiceNum,
|
|
163
|
+
invoiceCode: invoiceData.invoiceCode,
|
|
164
|
+
})
|
|
165
|
+
if (res.code === 200) {
|
|
166
|
+
showToast({
|
|
167
|
+
type: 'success',
|
|
168
|
+
message: '保存成功',
|
|
169
|
+
})
|
|
170
|
+
emit('saveSuccess')
|
|
171
|
+
}
|
|
172
|
+
} catch (err: any) {
|
|
173
|
+
showFailToast(err.msg)
|
|
174
|
+
emit('saveSuccess')
|
|
175
|
+
}
|
|
176
|
+
showLoading.value = false
|
|
177
|
+
}
|
|
178
|
+
</script>
|
|
179
|
+
|
|
180
|
+
<style lang="scss" scoped>
|
|
181
|
+
::v-deep {
|
|
182
|
+
.el-input-number {
|
|
183
|
+
width: 100%;
|
|
184
|
+
}
|
|
185
|
+
.el-input {
|
|
186
|
+
.el-input__wrapper {
|
|
187
|
+
width: 100%;
|
|
188
|
+
padding: 0 !important;
|
|
189
|
+
box-shadow: none;
|
|
190
|
+
}
|
|
191
|
+
.el-input__inner {
|
|
192
|
+
width: 100%;
|
|
193
|
+
text-align: left;
|
|
194
|
+
box-shadow: none;
|
|
195
|
+
padding: 0 !important;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
* {
|
|
200
|
+
padding: 0;
|
|
201
|
+
margin: 0;
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
}
|
|
204
|
+
.Invoice {
|
|
205
|
+
padding-bottom: 100px;
|
|
206
|
+
width: 100%;
|
|
207
|
+
min-height: 100%;
|
|
208
|
+
background-color: #f3f4f6;
|
|
209
|
+
.top {
|
|
210
|
+
width: 100%;
|
|
211
|
+
padding: 12px 4px;
|
|
212
|
+
img {
|
|
213
|
+
width: 100%;
|
|
214
|
+
height: 179px;
|
|
215
|
+
display: block;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.company {
|
|
220
|
+
height: inherit;
|
|
221
|
+
padding: 0 12px;
|
|
222
|
+
background-color: #fff;
|
|
223
|
+
.title {
|
|
224
|
+
padding: 18px 0;
|
|
225
|
+
font-size: 16px;
|
|
226
|
+
font-weight: 500;
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
border-bottom: 1px dashed #e8e8e8;
|
|
230
|
+
margin-bottom: 18px;
|
|
231
|
+
i {
|
|
232
|
+
display: inline-block;
|
|
233
|
+
width: 4px;
|
|
234
|
+
height: 14px;
|
|
235
|
+
background: #266fe8;
|
|
236
|
+
border-radius: 2px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
span {
|
|
240
|
+
font-size: 16px;
|
|
241
|
+
padding-left: 8px;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
.cardText {
|
|
245
|
+
.card {
|
|
246
|
+
margin-top: 8px;
|
|
247
|
+
border-radius: 4px;
|
|
248
|
+
background-color: #f6f6f6;
|
|
249
|
+
font-size: 14px;
|
|
250
|
+
.companyName {
|
|
251
|
+
padding: 15px;
|
|
252
|
+
}
|
|
253
|
+
.sellerInformation {
|
|
254
|
+
padding-left: 12px;
|
|
255
|
+
padding-bottom: 20px;
|
|
256
|
+
li {
|
|
257
|
+
list-style: none;
|
|
258
|
+
margin-bottom: 12px;
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
i {
|
|
262
|
+
width: 4px;
|
|
263
|
+
height: 4px;
|
|
264
|
+
border-radius: 50%;
|
|
265
|
+
background-color: #266fe8;
|
|
266
|
+
}
|
|
267
|
+
.label {
|
|
268
|
+
width: 120px;
|
|
269
|
+
margin-left: 12px;
|
|
270
|
+
white-space: nowrap;
|
|
271
|
+
}
|
|
272
|
+
.value {
|
|
273
|
+
flex: 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
.purchaser {
|
|
280
|
+
ul {
|
|
281
|
+
li {
|
|
282
|
+
display: flex;
|
|
283
|
+
font-size: 16px;
|
|
284
|
+
height: 50px;
|
|
285
|
+
align-items: center;
|
|
286
|
+
gap: 45px;
|
|
287
|
+
.label {
|
|
288
|
+
width: 80px;
|
|
289
|
+
white-space: nowrap;
|
|
290
|
+
position: relative;
|
|
291
|
+
.van-field__label--required {
|
|
292
|
+
position: absolute;
|
|
293
|
+
top: 0;
|
|
294
|
+
left: -8px;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
.input {
|
|
298
|
+
flex-grow: 1;
|
|
299
|
+
color: #999999;
|
|
300
|
+
|
|
301
|
+
input {
|
|
302
|
+
width: 100%;
|
|
303
|
+
color: #999999;
|
|
304
|
+
outline: none;
|
|
305
|
+
font-size: 16px;
|
|
306
|
+
border: none;
|
|
307
|
+
}
|
|
308
|
+
.errColor {
|
|
309
|
+
color: red;
|
|
310
|
+
font-size: 12px;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
.submit {
|
|
318
|
+
position: fixed;
|
|
319
|
+
bottom: 0;
|
|
320
|
+
left: 0;
|
|
321
|
+
width: 100%;
|
|
322
|
+
box-shadow: 0px -1px 12px 0px rgba(173, 173, 173, 0.1);
|
|
323
|
+
height: 90px;
|
|
324
|
+
display: flex;
|
|
325
|
+
justify-content: space-between;
|
|
326
|
+
align-items: center;
|
|
327
|
+
padding: 0 12px;
|
|
328
|
+
z-index: 2;
|
|
329
|
+
background-color: #fff;
|
|
330
|
+
span {
|
|
331
|
+
background-color: #266fe8;
|
|
332
|
+
width: 68%;
|
|
333
|
+
font-size: 15px;
|
|
334
|
+
color: #fff;
|
|
335
|
+
height: 44px;
|
|
336
|
+
text-align: center;
|
|
337
|
+
display: flex;
|
|
338
|
+
justify-content: center;
|
|
339
|
+
align-items: center;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
</style>
|
|
@@ -7,9 +7,17 @@ export const const_invoiceStatus: any = {
|
|
|
7
7
|
export const const_realStatus: any = {
|
|
8
8
|
noNeed: '无需验真',
|
|
9
9
|
notCheck: '未验真',
|
|
10
|
-
checked: '
|
|
10
|
+
checked: '验真通过',
|
|
11
11
|
checkFail: '验真异常',
|
|
12
12
|
}
|
|
13
|
+
export const const_invoiceExceptionInfo: any = {
|
|
14
|
+
abnormal: '异常发票',
|
|
15
|
+
invalid: '无效发票',
|
|
16
|
+
}
|
|
17
|
+
export const const_manualModify: any = {
|
|
18
|
+
手动录入: true,
|
|
19
|
+
非手动录入: false,
|
|
20
|
+
}
|
|
13
21
|
export const const_taskStatus: any = {
|
|
14
22
|
init: '初始状态',
|
|
15
23
|
upload_fail_cos: 'COS 上传失败',
|
|
@@ -31,7 +39,6 @@ export const setClass = (type: any) => {
|
|
|
31
39
|
return 'ok'
|
|
32
40
|
case 'used':
|
|
33
41
|
return 'default'
|
|
34
|
-
|
|
35
42
|
case 'noNeed':
|
|
36
43
|
return 'ok'
|
|
37
44
|
case 'notCheck':
|
|
@@ -40,6 +47,10 @@ export const setClass = (type: any) => {
|
|
|
40
47
|
return 'ok'
|
|
41
48
|
case 'checkFail':
|
|
42
49
|
return 'error'
|
|
50
|
+
case 'abnormal':
|
|
51
|
+
return 'error'
|
|
52
|
+
case 'invalid':
|
|
53
|
+
return 'error'
|
|
43
54
|
default:
|
|
44
55
|
return 'ok'
|
|
45
56
|
}
|
|
@@ -45,7 +45,15 @@
|
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
47
47
|
<div class="tags">
|
|
48
|
-
<span
|
|
48
|
+
<span v-if="item.manualModify" class="manual">
|
|
49
|
+
手工录入
|
|
50
|
+
</span>
|
|
51
|
+
<div v-else-if="item.invoiceExceptionInfo">
|
|
52
|
+
<span :class="setClass(item.invoiceExceptionInfo)">{{
|
|
53
|
+
const_invoiceExceptionInfo[item.invoiceExceptionInfo]
|
|
54
|
+
}}</span>
|
|
55
|
+
</div>
|
|
56
|
+
<span v-else :class="setClass(item.realStatus)">{{
|
|
49
57
|
const_realStatus[item.realStatus]
|
|
50
58
|
}}</span>
|
|
51
59
|
<span :class="setClass(item.invoiceStatus)">{{
|
|
@@ -182,30 +190,36 @@ import {
|
|
|
182
190
|
const_invoiceStatus,
|
|
183
191
|
const_realStatus,
|
|
184
192
|
const_taskStatus,
|
|
193
|
+
const_invoiceExceptionInfo,
|
|
185
194
|
setClass,
|
|
186
195
|
} from './const'
|
|
187
196
|
import { showImagePreview } from 'vant'
|
|
188
|
-
// console.log(addNumber('495.28', '29.72'))
|
|
189
197
|
const emit = defineEmits(['edit', 'ok'])
|
|
190
|
-
const { listId, multiple } = defineProps({
|
|
198
|
+
const { listId, multiple, catchList } = defineProps({
|
|
191
199
|
listId: {
|
|
192
|
-
required:
|
|
200
|
+
required: false,
|
|
193
201
|
type: String,
|
|
194
|
-
default: '1690918419274137620',
|
|
195
202
|
},
|
|
196
203
|
multiple: {
|
|
197
204
|
required: true,
|
|
198
205
|
type: Boolean,
|
|
199
206
|
},
|
|
207
|
+
catchList: {},
|
|
200
208
|
})
|
|
201
209
|
const token: any = ref(sessionStorage.getItem('token'))
|
|
202
210
|
const showLoading = ref(false)
|
|
203
211
|
const showPopup = ref(false)
|
|
204
|
-
const list = ref<Array<any>>([])
|
|
212
|
+
const list: any = ref<Array<any>>([])
|
|
213
|
+
if (catchList) {
|
|
214
|
+
list.value = catchList
|
|
215
|
+
}
|
|
205
216
|
const batchId = ref('')
|
|
206
217
|
const selectId = computed(() => {
|
|
207
|
-
return list.value
|
|
218
|
+
return list.value
|
|
219
|
+
.filter((item: any) => item.selected)
|
|
220
|
+
.map((item: any) => item.taskId)
|
|
208
221
|
})
|
|
222
|
+
|
|
209
223
|
const getList = async () => {
|
|
210
224
|
return new Promise(async (resolve, reject) => {
|
|
211
225
|
const data: any = {}
|
|
@@ -215,12 +229,17 @@ const getList = async () => {
|
|
|
215
229
|
const res: any = await __getUploadInvoiceList(data, token.value)
|
|
216
230
|
if (res.code === 200) {
|
|
217
231
|
list.value = res.data.invoiceList.map((item: any) => {
|
|
232
|
+
let data = list.value.find((v: any) => v.taskId === item.taskId) || {}
|
|
218
233
|
return {
|
|
219
|
-
...item,
|
|
220
|
-
selected: false,
|
|
234
|
+
...Object.assign(data, item),
|
|
221
235
|
}
|
|
222
236
|
})
|
|
223
237
|
batchId.value = res.data.batchId
|
|
238
|
+
if (list.value.length <= 0) {
|
|
239
|
+
selectedAll.value = false
|
|
240
|
+
} else {
|
|
241
|
+
changeItemCheckbox()
|
|
242
|
+
}
|
|
224
243
|
resolve(list.value)
|
|
225
244
|
}
|
|
226
245
|
} catch (error) {
|
|
@@ -232,8 +251,17 @@ const getList = async () => {
|
|
|
232
251
|
const clickItem = (row: any) => {
|
|
233
252
|
row.selected = !row.selected
|
|
234
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
|
+
}
|
|
235
263
|
const openDetails = (row: any) => {
|
|
236
|
-
if (row
|
|
264
|
+
if (!isEdit(row)) {
|
|
237
265
|
return
|
|
238
266
|
}
|
|
239
267
|
emit(
|
|
@@ -242,32 +270,35 @@ const openDetails = (row: any) => {
|
|
|
242
270
|
taskId: row.taskId,
|
|
243
271
|
batchId: batchId.value,
|
|
244
272
|
},
|
|
245
|
-
row
|
|
273
|
+
row,
|
|
274
|
+
list.value
|
|
246
275
|
)
|
|
247
276
|
}
|
|
248
|
-
const
|
|
277
|
+
const selectStatus = (item: any) => {
|
|
278
|
+
console.log(item)
|
|
279
|
+
// 未使用&& (验真通过||无需验真|| 手工录入||验真异常) && 发票推断状态错误值为空 && 发票识别任务已完成
|
|
249
280
|
return (
|
|
250
|
-
item.invoiceStatus === 'unused'
|
|
251
|
-
item.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
item.
|
|
257
|
-
|
|
258
|
-
|
|
281
|
+
item.invoiceStatus === 'unused' &&
|
|
282
|
+
(item.realStatus === 'checked' ||
|
|
283
|
+
item.realStatus === 'noNeed' ||
|
|
284
|
+
item.manualModify ||
|
|
285
|
+
item.realStatus === 'checkFail' ||
|
|
286
|
+
!item.invoiceExceptionInfo) &&
|
|
287
|
+
(item.taskStatus === 'ocr_success' ||
|
|
288
|
+
item.taskStatus === 'repeat' ||
|
|
289
|
+
item.taskStatus === 'finish')
|
|
259
290
|
)
|
|
260
291
|
}
|
|
261
292
|
const selectedAll: any = ref(false)
|
|
262
293
|
const changeSelectAll = (v: any) => {
|
|
263
|
-
list.value.forEach((item) => {
|
|
264
|
-
item.selected =
|
|
294
|
+
list.value.forEach((item: any) => {
|
|
295
|
+
item.selected = selectStatus(item) && selectedAll.value
|
|
265
296
|
})
|
|
266
297
|
}
|
|
267
298
|
const changeItemCheckbox = () => {
|
|
268
299
|
const status = list.value
|
|
269
|
-
.filter((item) =>
|
|
270
|
-
.every((item) => item.selected)
|
|
300
|
+
.filter((item: any) => selectStatus(item))
|
|
301
|
+
.every((item: any) => item.selected)
|
|
271
302
|
selectedAll.value = status
|
|
272
303
|
}
|
|
273
304
|
const deleteSelectItem = () => {
|
|
@@ -325,31 +356,18 @@ const selectImg = async (type: number) => {
|
|
|
325
356
|
}
|
|
326
357
|
const submitBtn = computed(() => {
|
|
327
358
|
const flag = list.value
|
|
328
|
-
.filter((item) => item.selected)
|
|
329
|
-
.every((item) => {
|
|
330
|
-
|
|
331
|
-
console.log(item.taskStatus, 'taskStatus')
|
|
332
|
-
console.log(item.realStatus, 'realStatus')
|
|
333
|
-
return everyStatus(item)
|
|
334
|
-
// item.invoiceStatus === 'unused' &&
|
|
335
|
-
// (item.taskStatus === 'ocr_success' ||
|
|
336
|
-
// item.taskStatus === 'repeat' ||
|
|
337
|
-
// item.taskStatus === 'finish' ||
|
|
338
|
-
// item.invoiceStatus === 'invalid' ||
|
|
339
|
-
// item.invoiceStatus === 'invalid' ||
|
|
340
|
-
// item.invoiceStatus === 'used' ||
|
|
341
|
-
// item.realStatus === 'noNeed' ||
|
|
342
|
-
// item.realStatus === 'notCheck' ||
|
|
343
|
-
// item.realStatus === 'checked' ||
|
|
344
|
-
// item.realStatus === 'checkFail')
|
|
359
|
+
.filter((item: any) => item.selected)
|
|
360
|
+
.every((item: any) => {
|
|
361
|
+
return selectStatus(item)
|
|
345
362
|
})
|
|
346
|
-
return flag && list.value.filter((item) => item.selected).length > 0
|
|
363
|
+
return flag && list.value.filter((item: any) => item.selected).length > 0
|
|
347
364
|
})
|
|
348
365
|
const selectedLength = computed(() => {
|
|
349
|
-
return list.value.filter((item) => item.selected &&
|
|
366
|
+
return list.value.filter((item: any) => item.selected && selectStatus(item))
|
|
367
|
+
.length
|
|
350
368
|
})
|
|
351
369
|
const selectedLengthCount = computed(() => {
|
|
352
|
-
return list.value.filter((item) =>
|
|
370
|
+
return list.value.filter((item: any) => selectStatus(item)).length
|
|
353
371
|
})
|
|
354
372
|
const openErrImg = (url: any) => {
|
|
355
373
|
showImagePreview([url])
|
|
@@ -360,11 +378,39 @@ const ok = () => {
|
|
|
360
378
|
return
|
|
361
379
|
}
|
|
362
380
|
if (!submitBtn.value) {
|
|
363
|
-
showToast({
|
|
381
|
+
showToast({
|
|
382
|
+
type: 'text',
|
|
383
|
+
message: '存在异常发票,无法提交, 请先去修改发票金额',
|
|
384
|
+
})
|
|
364
385
|
return
|
|
365
386
|
}
|
|
366
387
|
// showDeleteBtn.value = false
|
|
367
|
-
const selectData = list.value
|
|
388
|
+
const selectData = list.value
|
|
389
|
+
.filter((item: any) => item.selected)
|
|
390
|
+
.map((item: any) => {
|
|
391
|
+
let obj: any = { ...item }
|
|
392
|
+
// 验真状态 1,绿色 2,黄色, 3,红色
|
|
393
|
+
if (
|
|
394
|
+
item.realStatus === 'checked' ||
|
|
395
|
+
(item.realStatus === 'noNeed' && !item.manualModify)
|
|
396
|
+
) {
|
|
397
|
+
obj.verifyTruth = 1
|
|
398
|
+
} else if (item.manualModify) {
|
|
399
|
+
obj.verifyTruth = 2
|
|
400
|
+
} else {
|
|
401
|
+
obj.verifyTruth = 3
|
|
402
|
+
}
|
|
403
|
+
// 验重状态 1,绿色 2,黄色, 3,红色
|
|
404
|
+
if (item.invoiceStatus === 'unused') {
|
|
405
|
+
obj.checkWeight = 1
|
|
406
|
+
} else if (item.invoiceStatus === 'invalid') {
|
|
407
|
+
obj.checkWeight = 2
|
|
408
|
+
} else {
|
|
409
|
+
obj.checkWeight = 3
|
|
410
|
+
}
|
|
411
|
+
return obj
|
|
412
|
+
})
|
|
413
|
+
console.log(selectData, 'selectData')
|
|
368
414
|
emit('ok', selectData, batchId.value)
|
|
369
415
|
}
|
|
370
416
|
const timeID: any = ref(null)
|
|
@@ -484,6 +530,10 @@ onMounted(() => {
|
|
|
484
530
|
gap: 7px;
|
|
485
531
|
margin-top: 8px;
|
|
486
532
|
margin-bottom: 15px;
|
|
533
|
+
.manual {
|
|
534
|
+
background-color: #facd91;
|
|
535
|
+
color: #c77458;
|
|
536
|
+
}
|
|
487
537
|
span {
|
|
488
538
|
padding: 2px 4px;
|
|
489
539
|
font-size: 12px;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export const data = {
|
|
2
|
+
angle: '0',
|
|
3
|
+
attachmentLink:
|
|
4
|
+
'https://filegw.nuonuo.com/U1ylUBa5YlUHWOpta7hoLSC6QX9pEcu8Kcy-JnCnHTGn6PYXKNdZosH32iDDaLWGzhkY0N88rGOaS4w2krdeCw.png',
|
|
5
|
+
description: '增值税专用发票',
|
|
6
|
+
invoiceType: 'vat_special_invoice',
|
|
7
|
+
invoiceRootType: '专票',
|
|
8
|
+
position: '[0,0,2048,0,0,928,2048,928]',
|
|
9
|
+
checkCode: '',
|
|
10
|
+
clerk: '江海珍',
|
|
11
|
+
electronicMark: '0',
|
|
12
|
+
electronicNumber: '',
|
|
13
|
+
invoiceCode: '3300231130',
|
|
14
|
+
invoiceDate: '2023年07月17日',
|
|
15
|
+
invoiceNum: '08148218',
|
|
16
|
+
itemNames: '*住宿服务*住宿费',
|
|
17
|
+
noTaxAmountTotal: '212.87',
|
|
18
|
+
note: '',
|
|
19
|
+
payee: '王宝存',
|
|
20
|
+
payerAccount: '中信银行上海虹桥商务区支行8110201012601374925',
|
|
21
|
+
payerContact: '上海市闵行区沪青平公路277号5楼13301773703',
|
|
22
|
+
payerId: '91310112MA7BGUJL15',
|
|
23
|
+
payerName: '上海半小妖科技有限公司',
|
|
24
|
+
priceTaxTotalFigure: '215.00',
|
|
25
|
+
printCode: '0814821',
|
|
26
|
+
printNum: '0814821',
|
|
27
|
+
producerStamp: '浙江',
|
|
28
|
+
recheck: '金芬兰',
|
|
29
|
+
seal: '1',
|
|
30
|
+
sellerAccount: '温州银行股份有限公司营业部 745000120190095098',
|
|
31
|
+
sellerContact: '温州市瓯海娄桥古岸头村(不作拆迁凭证)0577-88812123',
|
|
32
|
+
sellerId: '913303046845118206',
|
|
33
|
+
sellerName: '温州蔬农招待所有限公司',
|
|
34
|
+
serviceName: '住宿服务',
|
|
35
|
+
taxAmountTotal: '2.13',
|
|
36
|
+
title: '浙江增值税专用发票',
|
|
37
|
+
totalCn: '贰佰壹拾伍圆整',
|
|
38
|
+
vatInvoicePage: '发票联',
|
|
39
|
+
nuonuoFileId: '3232300437-7d12c82340b84855a04e1f6d9d059c2f',
|
|
40
|
+
deatis: [
|
|
41
|
+
{
|
|
42
|
+
itemExTaxAmount: '212.87',
|
|
43
|
+
itemExTaxPrice: '',
|
|
44
|
+
itemName: '*住宿服务*住宿费',
|
|
45
|
+
itemQuantity: '',
|
|
46
|
+
itemSpec: '',
|
|
47
|
+
itemTaxAmount: '2.13',
|
|
48
|
+
itemTaxRate: '1%',
|
|
49
|
+
itemUtil: '',
|
|
50
|
+
id: 1345,
|
|
51
|
+
code: '1691272134678020096',
|
|
52
|
+
tenantCode: 'af9390a20cccc90fd174e5706f302769',
|
|
53
|
+
brandCode: '1645512743732000029',
|
|
54
|
+
createdAt: 1692065673000,
|
|
55
|
+
updatedAt: 1692065673000,
|
|
56
|
+
invoiceTableCode: '1691272117275852800',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
status: 'entered',
|
|
60
|
+
invoiceStatus: 'unused',
|
|
61
|
+
realStatus: 'checked',
|
|
62
|
+
fileUrlKey:
|
|
63
|
+
'https://invoice-sit-1251881907.cos.ap-nanjing.myqcloud.com/f8c6ff4af53241269c39dbd70f59cf6a.png?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDwtmcPMRRMAe9d4Sju00wq7KQPKAvZ6Yt%26q-sign-time%3D1693876509%3B1693876689%26q-key-time%3D1693876509%3B1693876689%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3Dd49201f59ae86085771f52b2df0b13f40556e848',
|
|
64
|
+
invoiceCompanyType: '公司',
|
|
65
|
+
taxRate: '1%',
|
|
66
|
+
taskStatus: 'repeat',
|
|
67
|
+
taskId: '1698867126367944704',
|
|
68
|
+
invoiceConsumptionType: 'accommodation',
|
|
69
|
+
invoiceConsumptionTypeInfo: '住宿费',
|
|
70
|
+
}
|