ba9f5e9a by renchao@pashanhoo.com

style:增加捷宇打卡器

1 parent 784f3522
...@@ -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,24 +596,70 @@ ...@@ -591,24 +596,70 @@
591 * @author: renchao 596 * @author: renchao
592 */ 597 */
593 readClick () { 598 readClick () {
594 getIdCardInfo().then(res => { 599 function getObjectByValue (arrayOfObjects, value) {
595 if (res.data.code == 0) { 600 var name = ''
596 let data = res.data.IDCardInfo 601 arrayOfObjects.forEach(item => {
597 this.ruleForm.qlrmc = data.name 602 if (item.dname.includes(value)) name = item.dcode
598 this.ruleForm.zjzl = '1' 603 })
599 this.ruleForm.zjh = data.cardID 604 return name
600 this.ruleForm.xb = data.sexCode 605 }
601 this.ruleForm.dz = data.address 606 getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
602 this.ruleForm.fzjg = data.issueOrgan 607 if (this.BASE_API.gaopaiyi == 'jy') {
603 this.$message({ 608 const {
604 message: '读取成功!', 609 Name,
605 type: 'success' 610 IdNo,
606 }) 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 }
607 } else { 634 } else {
608 this.$message({ 635 if (res.data.code == 0) {
609 message: res.data.message, 636 let data = res.data.IDCardInfo;
610 type: 'warning' 637 const {
611 }) 638 name,
639 cardID: zjh,
640 sexCode: xb,
641 address: txdz,
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
652 this.$message({
653 message: '读取成功!',
654 type: 'success'
655 })
656
657 } else {
658 this.$message({
659 message: res.data.message,
660 type: 'warning'
661 })
662 }
612 } 663 }
613 }) 664 })
614 }, 665 },
......
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,24 +585,60 @@ ...@@ -580,24 +585,60 @@
580 * @author: renchao 585 * @author: renchao
581 */ 586 */
582 readClick () { 587 readClick () {
583 getIdCardInfo().then(res => { 588 function getObjectByValue (arrayOfObjects, value) {
584 if (res.data.code == 0) { 589 var name = ''
585 let data = res.data.IDCardInfo 590 arrayOfObjects.forEach(item => {
586 this.ruleForm.ywrmc = data.name 591 if (item.dname.includes(value)) name = item.dcode
587 this.ruleForm.zjzl = '1' 592 })
588 this.ruleForm.zjh = data.cardID 593 return name
589 this.ruleForm.xb = data.sexCode 594 }
590 this.ruleForm.txdz = data.address 595 getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
591 this.ruleForm.fzjg = data.issueOrgan 596 if (this.BASE_API.gaopaiyi == 'jy') {
592 this.$message({ 597 const {
593 message: '读取成功!', 598 Name,
594 type: 'success' 599 IdNo,
595 }) 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 }
596 } else { 623 } else {
597 this.$message({ 624 if (res.data.code == 0) {
598 message: res.data.message, 625 let data = res.data.IDCardInfo
599 type: 'warning' 626 this.ruleForm.ywrmc = data.name
600 }) 627 this.ruleForm.zjzl = '1'
628 this.ruleForm.zjh = data.cardID
629 this.ruleForm.xb = data.sexCode
630 this.ruleForm.txdz = data.address
631 this.ruleForm.fzjg = data.issueOrgan
632 this.$message({
633 message: '读取成功!',
634 type: 'success'
635 })
636 } else {
637 this.$message({
638 message: res.data.message,
639 type: 'warning'
640 })
641 }
601 } 642 }
602 }) 643 })
603 }, 644 },
......
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,24 +600,70 @@ ...@@ -595,24 +600,70 @@
595 * @author: renchao 600 * @author: renchao
596 */ 601 */
597 readClick () { 602 readClick () {
598 getIdCardInfo().then(res => { 603 function getObjectByValue (arrayOfObjects, value) {
599 if (res.data.code == 0) { 604 var name = ''
600 let data = res.data.IDCardInfo 605 arrayOfObjects.forEach(item => {
601 this.ruleForm.sqrmc = data.name 606 if (item.dname.includes(value)) name = item.dcode
602 this.ruleForm.zjzl = '1' 607 })
603 this.ruleForm.zjh = data.cardID 608 return name
604 this.ruleForm.xb = data.sexCode 609 }
605 this.ruleForm.txdz = data.address 610 getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
606 this.ruleForm.fzjg = data.issueOrgan 611 if (this.BASE_API.gaopaiyi == 'jy') {
607 this.$message({ 612 const {
608 message: '读取成功!', 613 Name,
609 type: 'success' 614 IdNo,
610 }) 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 }
611 } else { 638 } else {
612 this.$message({ 639 if (res.data.code == 0) {
613 message: res.data.message, 640 let data = res.data.IDCardInfo;
614 type: 'warning' 641 const {
615 }) 642 name,
643 cardID: zjh,
644 sexCode: xb,
645 address: txdz,
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
656 this.$message({
657 message: '读取成功!',
658 type: 'success'
659 })
660
661 } else {
662 this.$message({
663 message: res.data.message,
664 type: 'warning'
665 })
666 }
616 } 667 }
617 }) 668 })
618 }, 669 },
......
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,24 +233,69 @@ ...@@ -231,24 +233,69 @@
231 * @author: renchao 233 * @author: renchao
232 */ 234 */
233 readClick (row) { 235 readClick (row) {
234 getIdCardInfo().then(res => { 236 function getObjectByValue (arrayOfObjects, value) {
235 if (res.data.code == 0) { 237 var name = ''
236 let data = res.data.IDCardInfo 238 arrayOfObjects.forEach(item => {
237 row.sqrmc = data.name 239 if (item.dname.includes(value)) name = item.dcode
238 row.zjzl = '1' 240 })
239 row.zjh = data.cardID 241 return name
240 row.xb = data.sexCode 242 }
241 row.txdz = data.address 243 getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
242 row.fzjg = data.issueOrgan 244 if (this.BASE_API.gaopaiyi == 'jy') {
243 this.$message({ 245 const {
244 message: '读取成功!', 246 Name,
245 type: 'success' 247 IdNo,
246 }) 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 }
247 } else { 271 } else {
248 this.$message({ 272 if (res.data.code == 0) {
249 message: res.data.message, 273 let data = res.data.IDCardInfo;
250 type: 'warning' 274 const {
251 }) 275 name,
276 cardID: zjh,
277 sexCode: xb,
278 address: txdz,
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
289 this.$message({
290 message: '读取成功!',
291 type: 'success'
292 })
293 } else {
294 this.$message({
295 message: res.data.message,
296 type: 'warning'
297 })
298 }
252 } 299 }
253 }) 300 })
254 }, 301 },
......
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,24 +204,69 @@ ...@@ -212,24 +204,69 @@
212 * @author: renchao 204 * @author: renchao
213 */ 205 */
214 readClick (row) { 206 readClick (row) {
215 getIdCardInfo().then(res => { 207 function getObjectByValue (arrayOfObjects, value) {
216 if (res.data.code == 0) { 208 var name = ''
217 let data = res.data.IDCardInfo 209 arrayOfObjects.forEach(item => {
218 row.sqrmc = data.name 210 if (item.dname.includes(value)) name = item.dcode
219 row.zjzl = '1' 211 })
220 row.zjh = data.cardID 212 return name
221 row.xb = data.sexCode 213 }
222 row.txdz = data.address 214 getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
223 row.fzjg = data.issueOrgan 215 if (this.BASE_API.gaopaiyi == 'jy') {
224 this.$message({ 216 const {
225 message: '读取成功!', 217 Name,
226 type: 'success' 218 IdNo,
227 }) 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 }
228 } else { 242 } else {
229 this.$message({ 243 if (res.data.code == 0) {
230 message: res.data.message, 244 let data = res.data.IDCardInfo;
231 type: 'warning' 245 const {
232 }) 246 name,
247 cardID: zjh,
248 sexCode: xb,
249 address: txdz,
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
260 this.$message({
261 message: '读取成功!',
262 type: 'success'
263 })
264 } else {
265 this.$message({
266 message: res.data.message,
267 type: 'warning'
268 })
269 }
233 } 270 }
234 }) 271 })
235 }, 272 },
......