mg-ocr-invoice 0.3.4 → 0.3.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.
@@ -1,345 +0,0 @@
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
- teleport:'#iDOCRInvoice'
170
-
171
- })
172
- emit('saveSuccess')
173
- }
174
- } catch (err: any) {
175
- showFailToast(err.msg)
176
- emit('saveSuccess')
177
- }
178
- showLoading.value = false
179
- }
180
- </script>
181
-
182
- <style lang="scss" scoped>
183
- ::v-deep {
184
- .el-input-number {
185
- width: 100%;
186
- }
187
- .el-input {
188
- .el-input__wrapper {
189
- width: 100%;
190
- padding: 0 !important;
191
- box-shadow: none;
192
- }
193
- .el-input__inner {
194
- width: 100%;
195
- text-align: left;
196
- box-shadow: none;
197
- padding: 0 !important;
198
- }
199
- }
200
- }
201
- * {
202
- padding: 0;
203
- margin: 0;
204
- box-sizing: border-box;
205
- }
206
- .Invoice {
207
- padding-bottom: 100px;
208
- width: 100%;
209
- min-height: 100%;
210
- background-color: #f3f4f6;
211
- .top {
212
- width: 100%;
213
- padding: 12px 4px;
214
- img {
215
- width: 100%;
216
- height: 179px;
217
- display: block;
218
- }
219
- }
220
-
221
- .company {
222
- height: inherit;
223
- padding: 0 12px;
224
- background-color: #fff;
225
- .title {
226
- padding: 18px 0;
227
- font-size: 16px;
228
- font-weight: 500;
229
- display: flex;
230
- align-items: center;
231
- border-bottom: 1px dashed #e8e8e8;
232
- margin-bottom: 18px;
233
- i {
234
- display: inline-block;
235
- width: 4px;
236
- height: 14px;
237
- background: #266fe8;
238
- border-radius: 2px;
239
- }
240
-
241
- span {
242
- font-size: 16px;
243
- padding-left: 8px;
244
- }
245
- }
246
- .cardText {
247
- .card {
248
- margin-top: 8px;
249
- border-radius: 4px;
250
- background-color: #f6f6f6;
251
- font-size: 14px;
252
- .companyName {
253
- padding: 15px;
254
- }
255
- .sellerInformation {
256
- padding-left: 12px;
257
- padding-bottom: 20px;
258
- li {
259
- list-style: none;
260
- margin-bottom: 12px;
261
- display: flex;
262
- align-items: center;
263
- i {
264
- width: 4px;
265
- height: 4px;
266
- border-radius: 50%;
267
- background-color: #266fe8;
268
- }
269
- .label {
270
- width: 120px;
271
- margin-left: 12px;
272
- white-space: nowrap;
273
- }
274
- .value {
275
- flex: 1;
276
- }
277
- }
278
- }
279
- }
280
- }
281
- .purchaser {
282
- ul {
283
- li {
284
- display: flex;
285
- font-size: 16px;
286
- height: 50px;
287
- align-items: center;
288
- gap: 45px;
289
- .label {
290
- width: 80px;
291
- white-space: nowrap;
292
- position: relative;
293
- .van-field__label--required {
294
- position: absolute;
295
- top: 0;
296
- left: -8px;
297
- }
298
- }
299
- .input {
300
- flex-grow: 1;
301
- color: #999999;
302
-
303
- input {
304
- width: 100%;
305
- color: #999999;
306
- outline: none;
307
- font-size: 16px;
308
- border: none;
309
- }
310
- .errColor {
311
- color: red;
312
- font-size: 12px;
313
- }
314
- }
315
- }
316
- }
317
- }
318
- }
319
- .submit {
320
- position: fixed;
321
- bottom: 0;
322
- left: 0;
323
- width: 100%;
324
- box-shadow: 0px -1px 12px 0px rgba(173, 173, 173, 0.1);
325
- height: 90px;
326
- display: flex;
327
- justify-content: space-between;
328
- align-items: center;
329
- padding: 0 12px;
330
- z-index: 2;
331
- background-color: #fff;
332
- span {
333
- background-color: #266fe8;
334
- width: 68%;
335
- font-size: 15px;
336
- color: #fff;
337
- height: 44px;
338
- text-align: center;
339
- display: flex;
340
- justify-content: center;
341
- align-items: center;
342
- }
343
- }
344
- }
345
- </style>