9bdfed1a by renchao@pashanhoo.com

Merge branch 'dev'

2 parents f550952d ba9f5e9a
......@@ -159,9 +159,38 @@ export function down (index, data) {
* @author: renchao
*/
export function getIdCardInfo (level) {
var webSocket = new WebSocket('ws://localhost:1818');
function start () {
return new Promise((resolve, reject) => {
webSocket.onopen = function (event) {
webSocket.send('ReadCard(1001,d:\\)');
}
webSocket.onerror = function (error) {
console.error('WebSocket发生错误:', error);
}
webSocket.onclose = function (event) {
if (event.wasClean) {
console.log(`WebSocket连接已关闭,代码: ${event.code}, 原因: ${event.reason}`);
} else {
console.error('WebSocket连接断开'); // 例如,服务器断电导致连接中断
}
}
webSocket.onmessage = function (event) {
if (event.data.indexOf('BeginReadCard') >= 0) {
// 处理数据并返回结果
const processedData = event.data.replace('BeginReadCard', '').replace('EndReadCard', '');
// 返回处理后的数据
resolve(processedData);
}
}
})
}
const resultMap = {
A: '设备',
default: axios.post(Vue.prototype.BASE_API.IDCARDURL),
jy: start(),
lt: axios.post(Vue.prototype.BASE_API.IDCARDURL),
default: axios.post(Vue.prototype.BASE_API.IDCARDURL)
}
return resultMap[level] || resultMap.default
}
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-10-17 13:18:17
* @LastEditTime: 2023-12-14 14:12:33
-->
<template>
<dialogBox
......@@ -25,6 +25,9 @@
:rules="rules"
ref="ruleForm"
label-width="120px">
<el-form-item label="头像">
<el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" />
</el-form-item>
<el-form-item label="身份证读卡器">
<el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button>
<el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button>
......@@ -353,6 +356,7 @@
},
data () {
return {
avatar: require('../../../../image/user.png'),
isShow: false,
isBz: false,
activeName: '1',
......@@ -380,6 +384,7 @@
gzdw: "",
hjszss: "",
qlrlx: "",
avatar: "",
qlrmc: "",
qlrtz: "",
sfczr: "",
......@@ -433,7 +438,7 @@
},
details: {
handler: function (val, oldVal) {
this.ruleForm = val;
this.ruleForm = _.cloneDeep(val)
},
deep: true
}
......@@ -591,24 +596,70 @@
* @author: renchao
*/
readClick () {
getIdCardInfo().then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
this.ruleForm.qlrmc = data.name
this.ruleForm.zjzl = '1'
this.ruleForm.zjh = data.cardID
this.ruleForm.xb = data.sexCode
this.ruleForm.dz = data.address
this.ruleForm.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
function getObjectByValue (arrayOfObjects, value) {
var name = ''
arrayOfObjects.forEach(item => {
if (item.dname.includes(value)) name = item.dcode
})
return name
}
getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
if (this.BASE_API.gaopaiyi == 'jy') {
const {
Name,
IdNo,
Sex,
Address,
Agencvy,
PhotoB64
} = JSON.parse(res)
this.ruleForm.sqrmc = Name;
this.ruleForm.zjzl = '1';
this.ruleForm.zjh = IdNo;
this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex);
this.ruleForm.txdz = Address;
this.ruleForm.fzjg = Agencvy;
this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64
if (this.ruleForm.sqrmc) {
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: '请重新放置身份证',
type: 'warning'
})
}
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
if (res.data.code == 0) {
let data = res.data.IDCardInfo;
const {
name,
cardID: zjh,
sexCode: xb,
address: txdz,
issueOrgan: fzjg,
photoBase64
} = data
this.ruleForm.sqrmc = name;
this.ruleForm.zjzl = '1';
this.ruleForm.zjh = zjh;
this.ruleForm.xb = xb
this.ruleForm.txdz = txdz;
this.ruleForm.fzjg = fzjg;
this.ruleForm.avatar = 'data:image/png;base64,' + photoBase64
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
}
})
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-10-17 13:20:04
* @LastEditTime: 2023-12-14 14:12:58
-->
<template>
<dialogBox
......@@ -25,6 +25,9 @@
v-if="activeName==1"
ref="ruleForm"
label-width="120px">
<el-form-item label="头像">
<el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" />
</el-form-item>
<el-form-item label="身份证读卡器">
<el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button>
<el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button>
......@@ -351,6 +354,7 @@
},
data () {
return {
avatar: require('../../../../image/user.png'),
isShow: false,
isBz: false,
activeName: '1',
......@@ -372,6 +376,7 @@
dzyj: "",
qlbl: "",
gzdw: "",
avatar: "",
dljg: "",
dlrxm: "",
dlrzjlx: "",
......@@ -420,7 +425,7 @@
},
details: {
handler: function (val, oldVal) {
this.ruleForm = val;
this.ruleForm = _.cloneDeep(val)
},
deep: true
}
......@@ -580,24 +585,60 @@
* @author: renchao
*/
readClick () {
getIdCardInfo().then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
this.ruleForm.ywrmc = data.name
this.ruleForm.zjzl = '1'
this.ruleForm.zjh = data.cardID
this.ruleForm.xb = data.sexCode
this.ruleForm.txdz = data.address
this.ruleForm.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
function getObjectByValue (arrayOfObjects, value) {
var name = ''
arrayOfObjects.forEach(item => {
if (item.dname.includes(value)) name = item.dcode
})
return name
}
getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
if (this.BASE_API.gaopaiyi == 'jy') {
const {
Name,
IdNo,
Sex,
Address,
Agencvy,
PhotoB64
} = JSON.parse(res)
this.ruleForm.sqrmc = Name;
this.ruleForm.zjzl = '1';
this.ruleForm.zjh = IdNo;
this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex);
this.ruleForm.txdz = Address;
this.ruleForm.fzjg = Agencvy;
this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64
if (this.ruleForm.sqrmc) {
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: '请重新放置身份证',
type: 'warning'
})
}
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
if (res.data.code == 0) {
let data = res.data.IDCardInfo
this.ruleForm.ywrmc = data.name
this.ruleForm.zjzl = '1'
this.ruleForm.zjh = data.cardID
this.ruleForm.xb = data.sexCode
this.ruleForm.txdz = data.address
this.ruleForm.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
}
})
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-26 16:47:20
* @LastEditTime: 2023-12-14 14:11:53
-->
<template>
<dialogBox
......@@ -26,7 +26,10 @@
:rules="rules"
ref="ruleForm"
label-width="120px">
<el-form-item label="身份证读卡器">
<el-form-item label="头像">
<el-image style="width:102px;height:126px" :src="ruleForm.avatar || avatar" fit="contain" />
</el-form-item>
<el-form-item label="身份证读卡器" style="margin-top:-20px">
<el-button type="text" icon="el-icon-tickets" :disabled="!showButton" @click="readClick">读取</el-button>
<el-button type="primary" v-if="isBz" @click="handleFilings">信息备案</el-button>
</el-form-item>
......@@ -276,7 +279,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="tableDataQy.data" border v-Loading="loading" :height="426.8">
<el-table :data="tableDataQy.data" border v-Loading="loading" :height="563">
<el-table-column label="序号" type="index" width="50" align="center">
<template slot-scope="scope">
{{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}}
......@@ -316,7 +319,7 @@
</el-col>
</el-row>
</el-form>
<el-table :data="tableDataYh.data" border v-Loading="loading" :height="426.8">
<el-table :data="tableDataYh.data" border v-Loading="loading" :height="563">
<el-table-column label="序号" type="index" width="50" align="center">
<template slot-scope="scope">
{{(pageData.currentPage - 1) * pageData.pageSize + scope.$index + 1}}
......@@ -355,6 +358,7 @@
},
data () {
return {
avatar: require('../../../../image/user.png'),
isShow: false,
isBz: false,
activeName: '1',
......@@ -362,7 +366,7 @@
myValue: this.value,
ruleForm: {
sqrlx: "",
sqrmc: "",
sqrmc: "111111",
zjzl: "",
zjh: "",
dh: "",
......@@ -378,6 +382,7 @@
qlbl: "",
gzdw: "",
dlrjg: "",
avatar: "",
dlrmc: "",
dlrzjlx: "",
dlrzjh: "",
......@@ -430,7 +435,7 @@
},
details: {
handler: function (val, oldVal) {
this.ruleForm = val;
this.ruleForm = _.cloneDeep(val);
},
deep: true
}
......@@ -595,24 +600,70 @@
* @author: renchao
*/
readClick () {
getIdCardInfo().then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
this.ruleForm.sqrmc = data.name
this.ruleForm.zjzl = '1'
this.ruleForm.zjh = data.cardID
this.ruleForm.xb = data.sexCode
this.ruleForm.txdz = data.address
this.ruleForm.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
function getObjectByValue (arrayOfObjects, value) {
var name = ''
arrayOfObjects.forEach(item => {
if (item.dname.includes(value)) name = item.dcode
})
return name
}
getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
if (this.BASE_API.gaopaiyi == 'jy') {
const {
Name,
IdNo,
Sex,
Address,
Agencvy,
PhotoB64
} = JSON.parse(res)
this.ruleForm.sqrmc = Name;
this.ruleForm.zjzl = '1';
this.ruleForm.zjh = IdNo;
this.ruleForm.xb = getObjectByValue(this.dictData['A43'], Sex);
this.ruleForm.txdz = Address;
this.ruleForm.fzjg = Agencvy;
this.ruleForm.avatar = 'data:image/png;base64,' + PhotoB64
if (this.ruleForm.sqrmc) {
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: '请重新放置身份证',
type: 'warning'
})
}
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
if (res.data.code == 0) {
let data = res.data.IDCardInfo;
const {
name,
cardID: zjh,
sexCode: xb,
address: txdz,
issueOrgan: fzjg,
photoBase64
} = data
this.ruleForm.sqrmc = name;
this.ruleForm.zjzl = '1';
this.ruleForm.zjh = zjh;
this.ruleForm.xb = xb
this.ruleForm.txdz = txdz;
this.ruleForm.fzjg = fzjg;
this.ruleForm.avatar = 'data:image/png;base64,' + photoBase64
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
}
})
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-09-26 16:40:49
* @LastEditTime: 2023-12-14 13:49:58
-->
<template>
<div>
......@@ -15,6 +15,7 @@
import { mapGetters } from 'vuex'
import { getIdCardInfo } from '@/utils/operation.js'
import addQlr from './dialog/addQlr.vue'
import { log } from 'bpmn-js-token-simulation'
export default {
components: {
addQlr
......@@ -124,12 +125,6 @@
let that = this
this.$nextTick(() => {
if (val.length == 0 || !val) {
// that.tableDataList = _.cloneDeep([{
// sqrmc: '',
// dlrzjlx: '',
// dlrzjh: '',
// fr: ''
// }])
} else {
that.tableDataList = _.cloneDeep(val)
}
......@@ -209,7 +204,14 @@
this.$message.warning("当前共有方式为单独所有,无法添加多个权利人")
} else {
this.key++
this.details = {}
this.details = {
sqrmc: '',
zjzl: '1',
zjh: '',
xb: '',
txdz: '',
fzjg: ''
}
this.dialog = true
this.isaddupdate = true
}
......@@ -231,24 +233,69 @@
* @author: renchao
*/
readClick (row) {
getIdCardInfo().then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
row.sqrmc = data.name
row.zjzl = '1'
row.zjh = data.cardID
row.xb = data.sexCode
row.txdz = data.address
row.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
function getObjectByValue (arrayOfObjects, value) {
var name = ''
arrayOfObjects.forEach(item => {
if (item.dname.includes(value)) name = item.dcode
})
return name
}
getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
if (this.BASE_API.gaopaiyi == 'jy') {
const {
Name,
IdNo,
Sex,
Address,
Agencvy,
PhotoB64
} = JSON.parse(res)
row.sqrmc = Name;
row.zjzl = '1';
row.zjh = IdNo;
row.xb = getObjectByValue(this.dictData['A43'], Sex);
row.txdz = Address;
row.fzjg = Agencvy;
row.avatar = 'data:image/png;base64,' + PhotoB64
if (row.sqrmc) {
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: '请重新放置身份证',
type: 'warning'
})
}
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
if (res.data.code == 0) {
let data = res.data.IDCardInfo;
const {
name,
cardID: zjh,
sexCode: xb,
address: txdz,
issueOrgan: fzjg,
photoBase64
} = data
row.sqrmc = name;
row.zjzl = '1';
row.zjh = zjh;
row.xb = xb
row.txdz = txdz;
row.fzjg = fzjg;
row.avatar = 'data:image/png;base64,' + photoBase64
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
}
})
},
......
<!--
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-10-11 13:56:35
* @LastEditTime: 2023-12-14 14:01:29
-->
<template>
<div>
......@@ -182,14 +182,6 @@
* @author: renchao
*/
addClick () {
// if (this.gyfs == '0' && this.tableDataList.length > 0) {
// this.$message.warning("当前共有方式为单独所有,无法添加多个权利人")
// } else {
// this.key++
// this.details = {}
// this.dialog = true
// this.isaddupdate = true
// }
this.key++
this.details = {}
this.dialog = true
......@@ -212,24 +204,69 @@
* @author: renchao
*/
readClick (row) {
getIdCardInfo().then(res => {
if (res.data.code == 0) {
let data = res.data.IDCardInfo
row.sqrmc = data.name
row.zjzl = '1'
row.zjh = data.cardID
row.xb = data.sexCode
row.txdz = data.address
row.fzjg = data.issueOrgan
this.$message({
message: '读取成功!',
type: 'success'
})
function getObjectByValue (arrayOfObjects, value) {
var name = ''
arrayOfObjects.forEach(item => {
if (item.dname.includes(value)) name = item.dcode
})
return name
}
getIdCardInfo(this.BASE_API.gaopaiyi).then(res => {
if (this.BASE_API.gaopaiyi == 'jy') {
const {
Name,
IdNo,
Sex,
Address,
Agencvy,
PhotoB64
} = JSON.parse(res)
row.sqrmc = Name;
row.zjzl = '1';
row.zjh = IdNo;
row.xb = getObjectByValue(this.dictData['A43'], Sex);
row.txdz = Address;
row.fzjg = Agencvy;
row.avatar = 'data:image/png;base64,' + PhotoB64
if (row.sqrmc) {
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: '请重新放置身份证',
type: 'warning'
})
}
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
if (res.data.code == 0) {
let data = res.data.IDCardInfo;
const {
name,
cardID: zjh,
sexCode: xb,
address: txdz,
issueOrgan: fzjg,
photoBase64
} = data
row.sqrmc = name;
row.zjzl = '1';
row.zjh = zjh;
row.xb = xb
row.txdz = txdz;
row.fzjg = fzjg;
row.avatar = 'data:image/png;base64,' + photoBase64
this.$message({
message: '读取成功!',
type: 'success'
})
} else {
this.$message({
message: res.data.message,
type: 'warning'
})
}
}
})
},
......