style:增加捷宇打卡器
Showing
7 changed files
with
318 additions
and
62 deletions
src/image/user.png
0 → 100644
4.22 KB
... | @@ -159,9 +159,38 @@ export function down (index, data) { | ... | @@ -159,9 +159,38 @@ export function down (index, data) { |
159 | * @author: renchao | 159 | * @author: renchao |
160 | */ | 160 | */ |
161 | export function getIdCardInfo (level) { | 161 | export function getIdCardInfo (level) { |
162 | var webSocket = new WebSocket('ws://localhost:1818'); | ||
163 | |||
164 | function start () { | ||
165 | return new Promise((resolve, reject) => { | ||
166 | webSocket.onopen = function (event) { | ||
167 | webSocket.send('ReadCard(1001,d:\\)'); | ||
168 | } | ||
169 | webSocket.onerror = function (error) { | ||
170 | console.error('WebSocket发生错误:', error); | ||
171 | } | ||
172 | |||
173 | webSocket.onclose = function (event) { | ||
174 | if (event.wasClean) { | ||
175 | console.log(`WebSocket连接已关闭,代码: ${event.code}, 原因: ${event.reason}`); | ||
176 | } else { | ||
177 | console.error('WebSocket连接断开'); // 例如,服务器断电导致连接中断 | ||
178 | } | ||
179 | } | ||
180 | webSocket.onmessage = function (event) { | ||
181 | if (event.data.indexOf('BeginReadCard') >= 0) { | ||
182 | // 处理数据并返回结果 | ||
183 | const processedData = event.data.replace('BeginReadCard', '').replace('EndReadCard', ''); | ||
184 | // 返回处理后的数据 | ||
185 | resolve(processedData); | ||
186 | } | ||
187 | } | ||
188 | }) | ||
189 | } | ||
162 | const resultMap = { | 190 | const resultMap = { |
163 | A: '设备', | 191 | jy: start(), |
164 | default: axios.post(Vue.prototype.BASE_API.IDCARDURL), | 192 | lt: axios.post(Vue.prototype.BASE_API.IDCARDURL), |
193 | default: axios.post(Vue.prototype.BASE_API.IDCARDURL) | ||
165 | } | 194 | } |
166 | return resultMap[level] || resultMap.default | 195 | return resultMap[level] || resultMap.default |
167 | } | 196 | } | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-10-17 13:18:17 | 4 | * @LastEditTime: 2023-12-14 14:12:33 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <dialogBox | 7 | <dialogBox |
... | @@ -25,6 +25,9 @@ | ... | @@ -25,6 +25,9 @@ |
25 | :rules="rules" | 25 | :rules="rules" |
26 | ref="ruleForm" | 26 | ref="ruleForm" |
27 | label-width="120px"> | 27 | label-width="120px"> |
28 | <el-form-item label="头像"> | ||
29 | <el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" /> | ||
30 | </el-form-item> | ||
28 | <el-form-item label="身份证读卡器"> | 31 | <el-form-item label="身份证读卡器"> |
29 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> | 32 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> |
30 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> | 33 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> |
... | @@ -353,6 +356,7 @@ | ... | @@ -353,6 +356,7 @@ |
353 | }, | 356 | }, |
354 | data () { | 357 | data () { |
355 | return { | 358 | return { |
359 | avatar: require('../../../../image/user.png'), | ||
356 | isShow: false, | 360 | isShow: false, |
357 | isBz: false, | 361 | isBz: false, |
358 | activeName: '1', | 362 | activeName: '1', |
... | @@ -380,6 +384,7 @@ | ... | @@ -380,6 +384,7 @@ |
380 | gzdw: "", | 384 | gzdw: "", |
381 | hjszss: "", | 385 | hjszss: "", |
382 | qlrlx: "", | 386 | qlrlx: "", |
387 | avatar: "", | ||
383 | qlrmc: "", | 388 | qlrmc: "", |
384 | qlrtz: "", | 389 | qlrtz: "", |
385 | sfczr: "", | 390 | sfczr: "", |
... | @@ -433,7 +438,7 @@ | ... | @@ -433,7 +438,7 @@ |
433 | }, | 438 | }, |
434 | details: { | 439 | details: { |
435 | handler: function (val, oldVal) { | 440 | handler: function (val, oldVal) { |
436 | this.ruleForm = val; | 441 | this.ruleForm = _.cloneDeep(val) |
437 | }, | 442 | }, |
438 | deep: true | 443 | deep: true |
439 | } | 444 | } |
... | @@ -591,25 +596,71 @@ | ... | @@ -591,25 +596,71 @@ |
591 | * @author: renchao | 596 | * @author: renchao |
592 | */ | 597 | */ |
593 | readClick () { | 598 | readClick () { |
594 | getIdCardInfo().then(res => { | 599 | function getObjectByValue (arrayOfObjects, value) { |
600 | var name = '' | ||
601 | arrayOfObjects.forEach(item => { | ||
602 | if (item.dname.includes(value)) name = item.dcode | ||
603 | }) | ||
604 | return name | ||
605 | } | ||
606 | getIdCardInfo(this.BASE_API.gaopaiyi).then(res => { | ||
607 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
608 | const { | ||
609 | Name, | ||
610 | IdNo, | ||
611 | Sex, | ||
612 | Address, | ||
613 | Agencvy, | ||
614 | PhotoB64 | ||
615 | } = JSON.parse(res) | ||
616 | this.ruleForm.sqrmc = Name; | ||
617 | this.ruleForm.zjzl = '1'; | ||
618 | this.ruleForm.zjh = IdNo; | ||
619 | this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex); | ||
620 | this.ruleForm.txdz = Address; | ||
621 | this.ruleForm.fzjg = Agencvy; | ||
622 | this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64 | ||
623 | if (this.ruleForm.sqrmc) { | ||
624 | this.$message({ | ||
625 | message: '读取成功!', | ||
626 | type: 'success' | ||
627 | }) | ||
628 | } else { | ||
629 | this.$message({ | ||
630 | message: '请重新放置身份证', | ||
631 | type: 'warning' | ||
632 | }) | ||
633 | } | ||
634 | } else { | ||
595 | if (res.data.code == 0) { | 635 | if (res.data.code == 0) { |
596 | let data = res.data.IDCardInfo | 636 | let data = res.data.IDCardInfo; |
597 | this.ruleForm.qlrmc = data.name | 637 | const { |
598 | this.ruleForm.zjzl = '1' | 638 | name, |
599 | this.ruleForm.zjh = data.cardID | 639 | cardID: zjh, |
600 | this.ruleForm.xb = data.sexCode | 640 | sexCode: xb, |
601 | this.ruleForm.dz = data.address | 641 | address: txdz, |
602 | this.ruleForm.fzjg = data.issueOrgan | 642 | issueOrgan: fzjg, |
643 | photoBase64 | ||
644 | } = data | ||
645 | this.ruleForm.sqrmc = name; | ||
646 | this.ruleForm.zjzl = '1'; | ||
647 | this.ruleForm.zjh = zjh; | ||
648 | this.ruleForm.xb = xb | ||
649 | this.ruleForm.txdz = txdz; | ||
650 | this.ruleForm.fzjg = fzjg; | ||
651 | this.ruleForm.avatar = 'data:image/png;base64,' + photoBase64 | ||
603 | this.$message({ | 652 | this.$message({ |
604 | message: '读取成功!', | 653 | message: '读取成功!', |
605 | type: 'success' | 654 | type: 'success' |
606 | }) | 655 | }) |
656 | |||
607 | } else { | 657 | } else { |
608 | this.$message({ | 658 | this.$message({ |
609 | message: res.data.message, | 659 | message: res.data.message, |
610 | type: 'warning' | 660 | type: 'warning' |
611 | }) | 661 | }) |
612 | } | 662 | } |
663 | } | ||
613 | }) | 664 | }) |
614 | }, | 665 | }, |
615 | /** | 666 | /** | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-10-17 13:20:04 | 4 | * @LastEditTime: 2023-12-14 14:12:58 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <dialogBox | 7 | <dialogBox |
... | @@ -25,6 +25,9 @@ | ... | @@ -25,6 +25,9 @@ |
25 | v-if="activeName==1" | 25 | v-if="activeName==1" |
26 | ref="ruleForm" | 26 | ref="ruleForm" |
27 | label-width="120px"> | 27 | label-width="120px"> |
28 | <el-form-item label="头像"> | ||
29 | <el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" /> | ||
30 | </el-form-item> | ||
28 | <el-form-item label="身份证读卡器"> | 31 | <el-form-item label="身份证读卡器"> |
29 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> | 32 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> |
30 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> | 33 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> |
... | @@ -351,6 +354,7 @@ | ... | @@ -351,6 +354,7 @@ |
351 | }, | 354 | }, |
352 | data () { | 355 | data () { |
353 | return { | 356 | return { |
357 | avatar: require('../../../../image/user.png'), | ||
354 | isShow: false, | 358 | isShow: false, |
355 | isBz: false, | 359 | isBz: false, |
356 | activeName: '1', | 360 | activeName: '1', |
... | @@ -372,6 +376,7 @@ | ... | @@ -372,6 +376,7 @@ |
372 | dzyj: "", | 376 | dzyj: "", |
373 | qlbl: "", | 377 | qlbl: "", |
374 | gzdw: "", | 378 | gzdw: "", |
379 | avatar: "", | ||
375 | dljg: "", | 380 | dljg: "", |
376 | dlrxm: "", | 381 | dlrxm: "", |
377 | dlrzjlx: "", | 382 | dlrzjlx: "", |
... | @@ -420,7 +425,7 @@ | ... | @@ -420,7 +425,7 @@ |
420 | }, | 425 | }, |
421 | details: { | 426 | details: { |
422 | handler: function (val, oldVal) { | 427 | handler: function (val, oldVal) { |
423 | this.ruleForm = val; | 428 | this.ruleForm = _.cloneDeep(val) |
424 | }, | 429 | }, |
425 | deep: true | 430 | deep: true |
426 | } | 431 | } |
... | @@ -580,7 +585,42 @@ | ... | @@ -580,7 +585,42 @@ |
580 | * @author: renchao | 585 | * @author: renchao |
581 | */ | 586 | */ |
582 | readClick () { | 587 | readClick () { |
583 | getIdCardInfo().then(res => { | 588 | function getObjectByValue (arrayOfObjects, value) { |
589 | var name = '' | ||
590 | arrayOfObjects.forEach(item => { | ||
591 | if (item.dname.includes(value)) name = item.dcode | ||
592 | }) | ||
593 | return name | ||
594 | } | ||
595 | getIdCardInfo(this.BASE_API.gaopaiyi).then(res => { | ||
596 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
597 | const { | ||
598 | Name, | ||
599 | IdNo, | ||
600 | Sex, | ||
601 | Address, | ||
602 | Agencvy, | ||
603 | PhotoB64 | ||
604 | } = JSON.parse(res) | ||
605 | this.ruleForm.sqrmc = Name; | ||
606 | this.ruleForm.zjzl = '1'; | ||
607 | this.ruleForm.zjh = IdNo; | ||
608 | this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex); | ||
609 | this.ruleForm.txdz = Address; | ||
610 | this.ruleForm.fzjg = Agencvy; | ||
611 | this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64 | ||
612 | if (this.ruleForm.sqrmc) { | ||
613 | this.$message({ | ||
614 | message: '读取成功!', | ||
615 | type: 'success' | ||
616 | }) | ||
617 | } else { | ||
618 | this.$message({ | ||
619 | message: '请重新放置身份证', | ||
620 | type: 'warning' | ||
621 | }) | ||
622 | } | ||
623 | } else { | ||
584 | if (res.data.code == 0) { | 624 | if (res.data.code == 0) { |
585 | let data = res.data.IDCardInfo | 625 | let data = res.data.IDCardInfo |
586 | this.ruleForm.ywrmc = data.name | 626 | this.ruleForm.ywrmc = data.name |
... | @@ -599,6 +639,7 @@ | ... | @@ -599,6 +639,7 @@ |
599 | type: 'warning' | 639 | type: 'warning' |
600 | }) | 640 | }) |
601 | } | 641 | } |
642 | } | ||
602 | }) | 643 | }) |
603 | }, | 644 | }, |
604 | /** | 645 | /** | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-09-26 16:47:20 | 4 | * @LastEditTime: 2023-12-14 14:11:53 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <dialogBox | 7 | <dialogBox |
... | @@ -26,7 +26,10 @@ | ... | @@ -26,7 +26,10 @@ |
26 | :rules="rules" | 26 | :rules="rules" |
27 | ref="ruleForm" | 27 | ref="ruleForm" |
28 | label-width="120px"> | 28 | label-width="120px"> |
29 | <el-form-item label="身份证读卡器"> | 29 | <el-form-item label="头像"> |
30 | <el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" /> | ||
31 | </el-form-item> | ||
32 | <el-form-item label="身份证读卡器" style="margin-top:-20px"> | ||
30 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> | 33 | <el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button> |
31 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> | 34 | <el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button> |
32 | </el-form-item> | 35 | </el-form-item> |
... | @@ -276,7 +279,7 @@ | ... | @@ -276,7 +279,7 @@ |
276 | </el-col> | 279 | </el-col> |
277 | </el-row> | 280 | </el-row> |
278 | </el-form> | 281 | </el-form> |
279 | <el-table :data="tableDataQy.data" border v-Loading="loading" :height="426.8"> | 282 | <el-table :data="tableDataQy.data" border v-Loading="loading" :height="563"> |
280 | <el-table-column label="序号" type="index" width="50" align="center"> | 283 | <el-table-column label="序号" type="index" width="50" align="center"> |
281 | <template slot-scope="scope"> | 284 | <template slot-scope="scope"> |
282 | {{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}} | 285 | {{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}} |
... | @@ -316,7 +319,7 @@ | ... | @@ -316,7 +319,7 @@ |
316 | </el-col> | 319 | </el-col> |
317 | </el-row> | 320 | </el-row> |
318 | </el-form> | 321 | </el-form> |
319 | <el-table :data="tableDataYh.data" border v-Loading="loading" :height="426.8"> | 322 | <el-table :data="tableDataYh.data" border v-Loading="loading" :height="563"> |
320 | <el-table-column label="序号" type="index" width="50" align="center"> | 323 | <el-table-column label="序号" type="index" width="50" align="center"> |
321 | <template slot-scope="scope"> | 324 | <template slot-scope="scope"> |
322 | {{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}} | 325 | {{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}} |
... | @@ -355,6 +358,7 @@ | ... | @@ -355,6 +358,7 @@ |
355 | }, | 358 | }, |
356 | data () { | 359 | data () { |
357 | return { | 360 | return { |
361 | avatar: require('../../../../image/user.png'), | ||
358 | isShow: false, | 362 | isShow: false, |
359 | isBz: false, | 363 | isBz: false, |
360 | activeName: '1', | 364 | activeName: '1', |
... | @@ -362,7 +366,7 @@ | ... | @@ -362,7 +366,7 @@ |
362 | myValue: this.value, | 366 | myValue: this.value, |
363 | ruleForm: { | 367 | ruleForm: { |
364 | sqrlx: "", | 368 | sqrlx: "", |
365 | sqrmc: "", | 369 | sqrmc: "111111", |
366 | zjzl: "", | 370 | zjzl: "", |
367 | zjh: "", | 371 | zjh: "", |
368 | dh: "", | 372 | dh: "", |
... | @@ -378,6 +382,7 @@ | ... | @@ -378,6 +382,7 @@ |
378 | qlbl: "", | 382 | qlbl: "", |
379 | gzdw: "", | 383 | gzdw: "", |
380 | dlrjg: "", | 384 | dlrjg: "", |
385 | avatar: "", | ||
381 | dlrmc: "", | 386 | dlrmc: "", |
382 | dlrzjlx: "", | 387 | dlrzjlx: "", |
383 | dlrzjh: "", | 388 | dlrzjh: "", |
... | @@ -430,7 +435,7 @@ | ... | @@ -430,7 +435,7 @@ |
430 | }, | 435 | }, |
431 | details: { | 436 | details: { |
432 | handler: function (val, oldVal) { | 437 | handler: function (val, oldVal) { |
433 | this.ruleForm = val; | 438 | this.ruleForm = _.cloneDeep(val); |
434 | }, | 439 | }, |
435 | deep: true | 440 | deep: true |
436 | } | 441 | } |
... | @@ -595,25 +600,71 @@ | ... | @@ -595,25 +600,71 @@ |
595 | * @author: renchao | 600 | * @author: renchao |
596 | */ | 601 | */ |
597 | readClick () { | 602 | readClick () { |
598 | getIdCardInfo().then(res => { | 603 | function getObjectByValue (arrayOfObjects, value) { |
604 | var name = '' | ||
605 | arrayOfObjects.forEach(item => { | ||
606 | if (item.dname.includes(value)) name = item.dcode | ||
607 | }) | ||
608 | return name | ||
609 | } | ||
610 | getIdCardInfo(this.BASE_API.gaopaiyi).then(res => { | ||
611 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
612 | const { | ||
613 | Name, | ||
614 | IdNo, | ||
615 | Sex, | ||
616 | Address, | ||
617 | Agencvy, | ||
618 | PhotoB64 | ||
619 | } = JSON.parse(res) | ||
620 | this.ruleForm.sqrmc = Name; | ||
621 | this.ruleForm.zjzl = '1'; | ||
622 | this.ruleForm.zjh = IdNo; | ||
623 | this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex); | ||
624 | this.ruleForm.txdz = Address; | ||
625 | this.ruleForm.fzjg = Agencvy; | ||
626 | this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64 | ||
627 | if (this.ruleForm.sqrmc) { | ||
628 | this.$message({ | ||
629 | message: '读取成功!', | ||
630 | type: 'success' | ||
631 | }) | ||
632 | } else { | ||
633 | this.$message({ | ||
634 | message: '请重新放置身份证', | ||
635 | type: 'warning' | ||
636 | }) | ||
637 | } | ||
638 | } else { | ||
599 | if (res.data.code == 0) { | 639 | if (res.data.code == 0) { |
600 | let data = res.data.IDCardInfo | 640 | let data = res.data.IDCardInfo; |
601 | this.ruleForm.sqrmc = data.name | 641 | const { |
602 | this.ruleForm.zjzl = '1' | 642 | name, |
603 | this.ruleForm.zjh = data.cardID | 643 | cardID: zjh, |
604 | this.ruleForm.xb = data.sexCode | 644 | sexCode: xb, |
605 | this.ruleForm.txdz = data.address | 645 | address: txdz, |
606 | this.ruleForm.fzjg = data.issueOrgan | 646 | issueOrgan: fzjg, |
647 | photoBase64 | ||
648 | } = data | ||
649 | this.ruleForm.sqrmc = name; | ||
650 | this.ruleForm.zjzl = '1'; | ||
651 | this.ruleForm.zjh = zjh; | ||
652 | this.ruleForm.xb = xb | ||
653 | this.ruleForm.txdz = txdz; | ||
654 | this.ruleForm.fzjg = fzjg; | ||
655 | this.ruleForm.avatar = 'data:image/png;base64,' + photoBase64 | ||
607 | this.$message({ | 656 | this.$message({ |
608 | message: '读取成功!', | 657 | message: '读取成功!', |
609 | type: 'success' | 658 | type: 'success' |
610 | }) | 659 | }) |
660 | |||
611 | } else { | 661 | } else { |
612 | this.$message({ | 662 | this.$message({ |
613 | message: res.data.message, | 663 | message: res.data.message, |
614 | type: 'warning' | 664 | type: 'warning' |
615 | }) | 665 | }) |
616 | } | 666 | } |
667 | } | ||
617 | }) | 668 | }) |
618 | }, | 669 | }, |
619 | /** | 670 | /** | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-09-26 16:40:49 | 4 | * @LastEditTime: 2023-12-14 13:49:58 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -15,6 +15,7 @@ | ... | @@ -15,6 +15,7 @@ |
15 | import { mapGetters } from 'vuex' | 15 | import { mapGetters } from 'vuex' |
16 | import { getIdCardInfo } from '@/utils/operation.js' | 16 | import { getIdCardInfo } from '@/utils/operation.js' |
17 | import addQlr from './dialog/addQlr.vue' | 17 | import addQlr from './dialog/addQlr.vue' |
18 | import { log } from 'bpmn-js-token-simulation' | ||
18 | export default { | 19 | export default { |
19 | components: { | 20 | components: { |
20 | addQlr | 21 | addQlr |
... | @@ -124,12 +125,6 @@ | ... | @@ -124,12 +125,6 @@ |
124 | let that = this | 125 | let that = this |
125 | this.$nextTick(() => { | 126 | this.$nextTick(() => { |
126 | if (val.length == 0 || !val) { | 127 | if (val.length == 0 || !val) { |
127 | // that.tableDataList = _.cloneDeep([{ | ||
128 | // sqrmc: '', | ||
129 | // dlrzjlx: '', | ||
130 | // dlrzjh: '', | ||
131 | // fr: '' | ||
132 | // }]) | ||
133 | } else { | 128 | } else { |
134 | that.tableDataList = _.cloneDeep(val) | 129 | that.tableDataList = _.cloneDeep(val) |
135 | } | 130 | } |
... | @@ -209,7 +204,14 @@ | ... | @@ -209,7 +204,14 @@ |
209 | this.$message.warning("当前共有方式为单独所有,无法添加多个权利人") | 204 | this.$message.warning("当前共有方式为单独所有,无法添加多个权利人") |
210 | } else { | 205 | } else { |
211 | this.key++ | 206 | this.key++ |
212 | this.details = {} | 207 | this.details = { |
208 | sqrmc: '', | ||
209 | zjzl: '1', | ||
210 | zjh: '', | ||
211 | xb: '', | ||
212 | txdz: '', | ||
213 | fzjg: '' | ||
214 | } | ||
213 | this.dialog = true | 215 | this.dialog = true |
214 | this.isaddupdate = true | 216 | this.isaddupdate = true |
215 | } | 217 | } |
... | @@ -231,15 +233,59 @@ | ... | @@ -231,15 +233,59 @@ |
231 | * @author: renchao | 233 | * @author: renchao |
232 | */ | 234 | */ |
233 | readClick (row) { | 235 | readClick (row) { |
234 | getIdCardInfo().then(res => { | 236 | function getObjectByValue (arrayOfObjects, value) { |
237 | var name = '' | ||
238 | arrayOfObjects.forEach(item => { | ||
239 | if (item.dname.includes(value)) name = item.dcode | ||
240 | }) | ||
241 | return name | ||
242 | } | ||
243 | getIdCardInfo(this.BASE_API.gaopaiyi).then(res => { | ||
244 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
245 | const { | ||
246 | Name, | ||
247 | IdNo, | ||
248 | Sex, | ||
249 | Address, | ||
250 | Agencvy, | ||
251 | PhotoB64 | ||
252 | } = JSON.parse(res) | ||
253 | row.sqrmc = Name; | ||
254 | row.zjzl = '1'; | ||
255 | row.zjh = IdNo; | ||
256 | row.xb = getObjectByValue(this.dictData['A43'], Sex); | ||
257 | row.txdz = Address; | ||
258 | row.fzjg = Agencvy; | ||
259 | row.avatar = 'data:image/png;base64,' + PhotoB64 | ||
260 | if (row.sqrmc) { | ||
261 | this.$message({ | ||
262 | message: '读取成功!', | ||
263 | type: 'success' | ||
264 | }) | ||
265 | } else { | ||
266 | this.$message({ | ||
267 | message: '请重新放置身份证', | ||
268 | type: 'warning' | ||
269 | }) | ||
270 | } | ||
271 | } else { | ||
235 | if (res.data.code == 0) { | 272 | if (res.data.code == 0) { |
236 | let data = res.data.IDCardInfo | 273 | let data = res.data.IDCardInfo; |
237 | row.sqrmc = data.name | 274 | const { |
238 | row.zjzl = '1' | 275 | name, |
239 | row.zjh = data.cardID | 276 | cardID: zjh, |
240 | row.xb = data.sexCode | 277 | sexCode: xb, |
241 | row.txdz = data.address | 278 | address: txdz, |
242 | row.fzjg = data.issueOrgan | 279 | issueOrgan: fzjg, |
280 | photoBase64 | ||
281 | } = data | ||
282 | row.sqrmc = name; | ||
283 | row.zjzl = '1'; | ||
284 | row.zjh = zjh; | ||
285 | row.xb = xb | ||
286 | row.txdz = txdz; | ||
287 | row.fzjg = fzjg; | ||
288 | row.avatar = 'data:image/png;base64,' + photoBase64 | ||
243 | this.$message({ | 289 | this.$message({ |
244 | message: '读取成功!', | 290 | message: '读取成功!', |
245 | type: 'success' | 291 | type: 'success' |
... | @@ -250,6 +296,7 @@ | ... | @@ -250,6 +296,7 @@ |
250 | type: 'warning' | 296 | type: 'warning' |
251 | }) | 297 | }) |
252 | } | 298 | } |
299 | } | ||
253 | }) | 300 | }) |
254 | }, | 301 | }, |
255 | /** | 302 | /** | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-10-11 13:56:35 | 4 | * @LastEditTime: 2023-12-14 14:01:29 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -182,14 +182,6 @@ | ... | @@ -182,14 +182,6 @@ |
182 | * @author: renchao | 182 | * @author: renchao |
183 | */ | 183 | */ |
184 | addClick () { | 184 | addClick () { |
185 | // if (this.gyfs == '0' && this.tableDataList.length > 0) { | ||
186 | // this.$message.warning("当前共有方式为单独所有,无法添加多个权利人") | ||
187 | // } else { | ||
188 | // this.key++ | ||
189 | // this.details = {} | ||
190 | // this.dialog = true | ||
191 | // this.isaddupdate = true | ||
192 | // } | ||
193 | this.key++ | 185 | this.key++ |
194 | this.details = {} | 186 | this.details = {} |
195 | this.dialog = true | 187 | this.dialog = true |
... | @@ -212,15 +204,59 @@ | ... | @@ -212,15 +204,59 @@ |
212 | * @author: renchao | 204 | * @author: renchao |
213 | */ | 205 | */ |
214 | readClick (row) { | 206 | readClick (row) { |
215 | getIdCardInfo().then(res => { | 207 | function getObjectByValue (arrayOfObjects, value) { |
208 | var name = '' | ||
209 | arrayOfObjects.forEach(item => { | ||
210 | if (item.dname.includes(value)) name = item.dcode | ||
211 | }) | ||
212 | return name | ||
213 | } | ||
214 | getIdCardInfo(this.BASE_API.gaopaiyi).then(res => { | ||
215 | if (this.BASE_API.gaopaiyi == 'jy') { | ||
216 | const { | ||
217 | Name, | ||
218 | IdNo, | ||
219 | Sex, | ||
220 | Address, | ||
221 | Agencvy, | ||
222 | PhotoB64 | ||
223 | } = JSON.parse(res) | ||
224 | row.sqrmc = Name; | ||
225 | row.zjzl = '1'; | ||
226 | row.zjh = IdNo; | ||
227 | row.xb = getObjectByValue(this.dictData['A43'], Sex); | ||
228 | row.txdz = Address; | ||
229 | row.fzjg = Agencvy; | ||
230 | row.avatar = 'data:image/png;base64,' + PhotoB64 | ||
231 | if (row.sqrmc) { | ||
232 | this.$message({ | ||
233 | message: '读取成功!', | ||
234 | type: 'success' | ||
235 | }) | ||
236 | } else { | ||
237 | this.$message({ | ||
238 | message: '请重新放置身份证', | ||
239 | type: 'warning' | ||
240 | }) | ||
241 | } | ||
242 | } else { | ||
216 | if (res.data.code == 0) { | 243 | if (res.data.code == 0) { |
217 | let data = res.data.IDCardInfo | 244 | let data = res.data.IDCardInfo; |
218 | row.sqrmc = data.name | 245 | const { |
219 | row.zjzl = '1' | 246 | name, |
220 | row.zjh = data.cardID | 247 | cardID: zjh, |
221 | row.xb = data.sexCode | 248 | sexCode: xb, |
222 | row.txdz = data.address | 249 | address: txdz, |
223 | row.fzjg = data.issueOrgan | 250 | issueOrgan: fzjg, |
251 | photoBase64 | ||
252 | } = data | ||
253 | row.sqrmc = name; | ||
254 | row.zjzl = '1'; | ||
255 | row.zjh = zjh; | ||
256 | row.xb = xb | ||
257 | row.txdz = txdz; | ||
258 | row.fzjg = fzjg; | ||
259 | row.avatar = 'data:image/png;base64,' + photoBase64 | ||
224 | this.$message({ | 260 | this.$message({ |
225 | message: '读取成功!', | 261 | message: '读取成功!', |
226 | type: 'success' | 262 | type: 'success' |
... | @@ -231,6 +267,7 @@ | ... | @@ -231,6 +267,7 @@ |
231 | type: 'warning' | 267 | type: 'warning' |
232 | }) | 268 | }) |
233 | } | 269 | } |
270 | } | ||
234 | }) | 271 | }) |
235 | }, | 272 | }, |
236 | /** | 273 | /** | ... | ... |
-
Please register or sign in to post a comment