Browse Source

idcard seo

master
pengjun 2 years ago
parent
commit
f02019d58a
  1. BIN
      public/pic/Photo.jpg
  2. 103
      src/components/patientRegister/PatientRegisterEdit.vue
  3. 1
      src/components/patientRegister/PatientRegisterList.vue
  4. 4
      src/components/sumDoctorCheck/ButtonList.vue
  5. 19
      src/store/index.js
  6. 7
      src/utlis/mm.js
  7. 171
      src/utlis/proFunc.js

BIN
public/pic/Photo.jpg

After

Width: 152  |  Height: 160  |  Size: 14 KiB

103
src/components/patientRegister/PatientRegisterEdit.vue

@ -315,7 +315,7 @@
</el-form> </el-form>
<el-image <el-image
:style="'position: absolute;top:65px;right:' + (110 + Math.floor((window.pageWidth - 750) / 24)) + 'px; width: 150px; height: 160px;'" :style="'position: absolute;top:65px;right:' + (110 + Math.floor((window.pageWidth - 750) / 24)) + 'px; width: 150px; height: 160px;'"
:src="form.photo ? (apiurl + '/' + form.photo) : ''">
:src="photoParse(patientRegister.photo)">
<div slot="placeholder" class="image-slot"> <div slot="placeholder" class="image-slot">
加载中<span class="dot">...</span> 加载中<span class="dot">...</span>
</div> </div>
@ -327,10 +327,10 @@
</div> </div>
<div style="margin-left: 10px;width:110px;"> <div style="margin-left: 10px;width:110px;">
<div style="margin-top: -20px;"> <div style="margin-top: -20px;">
<el-button type="primary" class="btnClass" @click="openCamera" icon="el-icon-camera">拍照</el-button>
<el-button type="primary" class="btnClass" @click="photoGrah" icon="el-icon-camera">拍照</el-button>
</div> </div>
<div class="btn"> <div class="btn">
<el-button @click="readIdCard" class="btnClass">读身份证</el-button>
<el-button @click="peopleIcCard" class="btnClass">读身份证</el-button>
</div> </div>
<div class="btn"> <div class="btn">
<el-button type="primary" class="btnClass" @click="rdCopy">复制新增</el-button> <el-button type="primary" class="btnClass" @click="rdCopy">复制新增</el-button>
@ -445,11 +445,12 @@
<el-button type="primary" @click="choosePatient" style="width:90px;">确定</el-button> <el-button type="primary" @click="choosePatient" style="width:90px;">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 拍照 -->
<!-- 拍照openCamera 网页模式已废弃
<el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="600" <el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="600"
:close-on-click-modal="false" :append-to-body="true"> :close-on-click-modal="false" :append-to-body="true">
<Camera :id="form.id" />
<Camera :id="form.id" />
</el-dialog> </el-dialog>
-->
<!-- 检验条码补打 --> <!-- 检验条码补打 -->
<el-dialog title="检验条码补打" :visible.sync="patientRegister.lisRequestVisble" width="600px" height="400" <el-dialog title="检验条码补打" :visible.sync="patientRegister.lisRequestVisble" width="600px" height="400"
:show-close="false" :close-on-click-modal="false" :append-to-body="true"> :show-close="false" :close-on-click-modal="false" :append-to-body="true">
@ -471,7 +472,7 @@ import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import mm from "../../utlis/mm"; import mm from "../../utlis/mm";
import { objCopy, setNull, dddw, parseID, birthdayToAge, deepCopy, arrayFilter } from "../../utlis/proFunc";
import { objCopy, setNull, dddw, parseID, birthdayToAge, deepCopy, arrayFilter, parsIcCardtoLocal, photoParse, savePeoplePhoto } from "../../utlis/proFunc";
import Camera from "./Camera.vue"; import Camera from "./Camera.vue";
import PatientRegisterItem from "./PatientRegisterItem.vue"; import PatientRegisterItem from "./PatientRegisterItem.vue";
import LisRequest from "./LisRequest.vue"; import LisRequest from "./LisRequest.vue";
@ -509,7 +510,6 @@ export default {
personnelTypeId: null, // personnelTypeId: null, //
jobPost: "", // jobPost: "", //
jobTitle: "", // jobTitle: "", //
photo: "", //
salesman: "", // salesman: "", //
sexHormoneTermId: null, // sexHormoneTermId: null, //
isNameHide: "N", // isNameHide: "N", //
@ -587,18 +587,35 @@ export default {
}, },
computed: { computed: {
...mapState(["window", "dict", "patientRegister", "customerOrg"]),
...mapState(["window", "dict", "patientRegister", "customerOrg", "projPriv"]),
}, },
methods: { methods: {
readIdCard() {
console.log("this.form1", this.form);
photoParse,
peopleIcCard() {
this.$peisAPI.peopleIcCard().then(res => {
//console.log('peopleIcCard',res)
let lres = JSON.parse(res)
if (lres.Code && lres.Code.toLowerCase() == 'success') {
this.projPriv.idNos = lres
let idNos = parsIcCardtoLocal(this.projPriv.idNos, this.dict.sex, this.dict.nation)
this.form.patientName = idNos.Name
this.form.birthDate = idNos.birthDate
this.form.sexId = idNos.sexId
this.form.age = idNos.age
this.form.nationId = idNos.nationId
this.form.idNo = idNos.IDCode
this.form.address = idNos.Address
this.patientRegister.photo = 'data:image/bmp;base64,' + idNos.Photo
}
})
}, },
// //
async getCustomerOrgRegisterList() { async getCustomerOrgRegisterList() {
this.customerOrgRegisterList = [] this.customerOrgRegisterList = []
if (this.form.customerOrgId == this.dict.personOrgId){
this.form.customerOrgRegisterId = null
if (this.form.customerOrgId == this.dict.personOrgId) {
this.form.customerOrgRegisterId = null
return return
} }
try { try {
@ -627,14 +644,14 @@ export default {
}, },
// //
getCustomerOrgGroup(customerOrgRegisterId){
getCustomerOrgGroup(customerOrgRegisterId) {
this.patientRegister.customerOrgGroup = [] this.patientRegister.customerOrgGroup = []
getapi(`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`).then(res => { getapi(`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`).then(res => {
if (res.code != - 1) { if (res.code != - 1) {
this.patientRegister.customerOrgGroup = res.data.items; this.patientRegister.customerOrgGroup = res.data.items;
} }
}) })
},
},
// //
changeBirthDate() { changeBirthDate() {
@ -652,7 +669,7 @@ export default {
}, },
// //
changeCustomerOrgGroupId() {
changeCustomerOrgGroupId() {
this.patientRegister.customerOrgGroupChange++; this.patientRegister.customerOrgGroupChange++;
if (this.form.id) this.Onsubmit('form', false); if (this.form.id) this.Onsubmit('form', false);
}, },
@ -774,6 +791,11 @@ export default {
// //
let body = deepCopy(this.form); let body = deepCopy(this.form);
if(this.form.birthDate){
body.birthDate = moment(this.form.birthDate).format("yyyy-MM-DD")
}
delete body.id; delete body.id;
delete body.patientRegisterNo; delete body.patientRegisterNo;
delete body.medicalTimes; delete body.medicalTimes;
@ -788,6 +810,7 @@ export default {
delete body.isNameHideBox; delete body.isNameHideBox;
delete body.isPhoneFollowBox; delete body.isPhoneFollowBox;
delete body.isLockBox; delete body.isLockBox;
delete body.photo;
setNull(body, this.defaultNull); setNull(body, this.defaultNull);
@ -807,6 +830,9 @@ export default {
if (res.code == 1) { if (res.code == 1) {
//console.log('res',res) //console.log('res',res)
if (msgTip) this.$message.success("创健 操作成功"); if (msgTip) this.$message.success("创健 操作成功");
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
objCopy(res.data, this.form); objCopy(res.data, this.form);
// this.patientRegister.prList.push(res.data); // // this.patientRegister.prList.push(res.data); //
this.patientRegister.patientRegisterId = res.data.id; this.patientRegister.patientRegisterId = res.data.id;
@ -827,6 +853,8 @@ export default {
postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => { postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => {
if (res.code == 1) { if (res.code == 1) {
if (msgTip) this.$message.success("更新 操作成功"); if (msgTip) this.$message.success("更新 操作成功");
//
if (this.patientRegister.photo.indexOf("data:image") > -1) savePeoplePhoto(res.data.id, this.patientRegister.photo);
this.patientRegister.query.times++; this.patientRegister.query.times++;
//this.patientRegister.saveTimes++; // //this.patientRegister.saveTimes++; //
} }
@ -875,7 +903,7 @@ export default {
}); });
}, },
//
//
openCamera() { openCamera() {
if (!this.form.id) { if (!this.form.id) {
alert("请先保存人员信息"); alert("请先保存人员信息");
@ -884,6 +912,49 @@ export default {
this.patientRegister.cameraVisble = true; this.patientRegister.cameraVisble = true;
}, },
//
photoGrah() {
if (!this.form.id) {
alert("请先保存人员信息");
return;
}
this.$peisAPI.photoGrah()
.then(res => {
console.log(res)
//alert(res)
let lres = JSON.parse(res)
if (lres.Code && lres.Code.toLowerCase() == 'success') {
let uploadPhoto = {
patientRegisterId: this.form.id,
photo: lres.Photo,
};
this.patientRegister.photo = `data:image/${lres.PhotoFormat};base64,${lres.Photo}`
return postapi(`/api/app/patient-register/up-load-img`, uploadPhoto)
} else {
this.$message.error("上传照片错误" + lres.Code)
}
}).then(res => {
if (res.code == 1) {
let body = {
patientRegisterId: this.form.id,
photo: res.data,
};
console.log(body);
return postapi(`/api/app/patient-register/update-photo`, body);
}
}).then(res => {
if (res.code != -1) {
//console.log('',res.data)
this.patientRegister.patientRegisterRd.photo = res.data.photo
this.$message.success("操作成功");
}
}).catch(err => {
console.log('this.$peisAPI.photoGrah', err)
})
},
// (isPreview) // (isPreview)
async guidePrint(ReportCode, isPreview) { async guidePrint(ReportCode, isPreview) {
if (this.form.id.length < 1) { if (this.form.id.length < 1) {

1
src/components/patientRegister/PatientRegisterList.vue

@ -460,6 +460,7 @@ export default {
this.patientRegister.photo = ""; // this.patientRegister.photo = ""; //
this.patientRegister.patientRegisterId = row.id; this.patientRegister.patientRegisterId = row.id;
this.patientRegister.photo = row.photo;
this.patientRegister.patientRegisterRd = row; this.patientRegister.patientRegisterRd = row;
this.patientRegister.query.customerOrgParentId = row.customerOrgParentId; this.patientRegister.query.customerOrgParentId = row.customerOrgParentId;
this.patientRegister.customerOrgGroupChange = 0; //0 this.patientRegister.customerOrgGroupChange = 0; //0

4
src/components/sumDoctorCheck/ButtonList.vue

@ -46,9 +46,9 @@
<PatientRegisterList win="sumDoctorCheck" /> <PatientRegisterList win="sumDoctorCheck" />
</el-drawer> </el-drawer>
<el-drawer title="诊断列表" :visible.sync="sumDoctorCheck.sumDiagnosisVisible" direction="rtl" size="400"
<el-drawer title="诊断列表" :visible.sync="sumDoctorCheck.sumDiagnosisVisible" direction="ltr" size="300"
:wrapperClosable="false"> :wrapperClosable="false">
<SumDiagnosis win="sumDoctorCheck" />
<SumDiagnosis win="sumDoctorCheck.sumPREdit.id" />
</el-drawer> </el-drawer>
</div> </div>

19
src/store/index.js

@ -54,7 +54,7 @@ export default new Vuex.Store({
patientRegisterTimes: 0, //体检人员登记窗口显示次数(弃用) patientRegisterTimes: 0, //体检人员登记窗口显示次数(弃用)
addTimes: 0, //用于触发新增时初始化赋值 addTimes: 0, //用于触发新增时初始化赋值
saveTimes: 0, //用于体检登记时,触发分组调整保存 saveTimes: 0, //用于体检登记时,触发分组调整保存
photo: "", //单独抽出,拍照时会更新
photo: "/pic/Photo.jpg", //单独抽出,拍照时会更新
cameraVisble: false, //拍照控件显示 cameraVisble: false, //拍照控件显示
lisRequestVisble: false, //检验条码补打 lisRequestVisble: false, //检验条码补打
mergeAsbitemVisble: false, //合并项目 mergeAsbitemVisble: false, //合并项目
@ -227,6 +227,23 @@ export default new Vuex.Store({
asbItem: [], //显示的 未选组合项目 asbItem: [], //显示的 未选组合项目
asbItemQuick: [], //显示的 未选组合项目(供快速选择) asbItemQuick: [], //显示的 未选组合项目(供快速选择)
}, },
//项目特有的对象数据
projPriv:{
idNos:{
Code: "Success", //读取成功/失败
Name: "刘滔",
Sex: "男",
Nation: "汉",
Birthday: "1986-01-22",
Address: "湖南省长沙县春华镇九木村新元组367号",
DepartmentIC: "长沙县公安局",
StartDateIC: "2019-11-25",
EndDateIC: "2039-11-25",
IDCode: "430121198601223693",
Photo: "base64编码字符串"
}, //读取身份证信息
},
}, },
getters: {}, getters: {},

7
src/utlis/mm.js

@ -1,3 +1,8 @@
export default{
// export default{
// apiurl:'http://140.143.162.39:9529',
// }
// modify by pengjun
module.exports = {
apiurl:'http://140.143.162.39:9529', apiurl:'http://140.143.162.39:9529',
} }

171
src/utlis/proFunc.js

@ -1,16 +1,22 @@
// import sysConfig from "./mm";
// import { getapi, postapi, putapi, deletapi } from "@/api/api";
const sysConfig = require('./mm');
const {getapi, postapi, putapi, deletapi} = require('../api/api');
//多级联动选择数据处理 add by pengjun //多级联动选择数据处理 add by pengjun
exports.tcdate = (date) => {
function tcdate(date) {
for (var i = 0; i < date.length; i++) { for (var i = 0; i < date.length; i++) {
if (date[i].treeChildren.length == 0) { if (date[i].treeChildren.length == 0) {
date[i].treeChildren = undefined; date[i].treeChildren = undefined;
} else { } else {
this.tcdate(date[i].treeChildren);
tcdate(date[i].treeChildren);
} }
} }
}; };
exports.tcdate = tcdate;
//json 对像赋值 只从 from 对象 赋值 to 中有的 key 项 add by pengjun //json 对像赋值 只从 from 对象 赋值 to 中有的 key 项 add by pengjun
exports.objCopy = (from, to) => {
function objCopy(from, to) {
if (from && to) { if (from && to) {
let keys = Object.keys(to); let keys = Object.keys(to);
for (let key in keys) { for (let key in keys) {
@ -20,30 +26,32 @@ exports.objCopy = (from, to) => {
} }
} }
}; };
exports.objCopy = objCopy;
//对象深拷贝 //对象深拷贝
function deepCopy(obj) { function deepCopy(obj) {
if (obj == null || typeof obj != 'object') { if (obj == null || typeof obj != 'object') {
return obj;
return obj;
} }
let copy; let copy;
if (Array.isArray(obj)) { if (Array.isArray(obj)) {
copy = [];
for (let i = 0; i < obj.length; i++) {
copy[i] = deepCopy(obj[i]);
}
copy = [];
for (let i = 0; i < obj.length; i++) {
copy[i] = deepCopy(obj[i]);
}
} else { } else {
copy = {};
for (let key in obj) {
copy[key] = deepCopy(obj[key]);
}
copy = {};
for (let key in obj) {
copy[key] = deepCopy(obj[key]);
}
} }
return copy; return copy;
}; };
exports.deepCopy = deepCopy; exports.deepCopy = deepCopy;
//类似PB中的dddw的功能 add by pengjun //类似PB中的dddw的功能 add by pengjun
exports.dddw = (arrayData, key, value, display) => {
function dddw(arrayData, key, value, display) {
//console.log(arrayData,key,value,display) //console.log(arrayData,key,value,display)
let ret = value; let ret = value;
if (arrayData) { if (arrayData) {
@ -56,9 +64,10 @@ exports.dddw = (arrayData, key, value, display) => {
} }
return ret; return ret;
}; };
exports.dddw = dddw;
//一般uuid字段为空时,需设置为null值 //一般uuid字段为空时,需设置为null值
exports.setNull = (obj, arrayKeys) => {
function setNull(obj, arrayKeys) {
if (arrayKeys) { if (arrayKeys) {
for (let i = 0; i < arrayKeys.length; i++) { for (let i = 0; i < arrayKeys.length; i++) {
if (!obj[arrayKeys[i]] || obj[arrayKeys[i]].length < 1) { if (!obj[arrayKeys[i]] || obj[arrayKeys[i]].length < 1) {
@ -67,9 +76,10 @@ exports.setNull = (obj, arrayKeys) => {
} }
} }
}; };
exports.setNull = setNull;
//将字符串转换成二进制形式,中间用空格隔开 //将字符串转换成二进制形式,中间用空格隔开
exports.strToBinary = function (str) {
function strToBinary(str) {
let result = []; let result = [];
let list = str.split(""); let list = str.split("");
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
@ -82,9 +92,10 @@ exports.strToBinary = function (str) {
} }
return result.join(""); return result.join("");
}; };
exports.strToBinary = strToBinary;
//将二进制字符串转换成Unicode字符串 //将二进制字符串转换成Unicode字符串
exports.binaryToStr = function (str) {
function binaryToStr(str) {
var result = []; var result = [];
var list = str.split(" "); var list = str.split(" ");
for (var i = 0; i < list.length; i++) { for (var i = 0; i < list.length; i++) {
@ -95,9 +106,10 @@ exports.binaryToStr = function (str) {
} }
return result.join(""); return result.join("");
}; };
exports.binaryToStr = binaryToStr;
//数组过滤出符合条件的 //数组过滤出符合条件的
exports.arrayFilter = function (arr, key, value) {
function arrayFilter(arr, key, value) {
let result = []; let result = [];
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
if (arr[i][key] == value) { if (arr[i][key] == value) {
@ -106,9 +118,10 @@ exports.arrayFilter = function (arr, key, value) {
} }
return result; return result;
}; };
exports.arrayFilter = arrayFilter;
//数组相减 arrFront = arrFront - reduceArr ; //数组相减 arrFront = arrFront - reduceArr ;
exports.arrayReduce = function (arrFront, reduceArr, key) {
function arrayReduce(arrFront, reduceArr, key) {
let keys = key.split("="); let keys = key.split("=");
let keyF = keys[0]; let keyF = keys[0];
let keyR = keys.length > 1 ? keys[1] : keys[0]; let keyR = keys.length > 1 ? keys[1] : keys[0];
@ -128,51 +141,133 @@ exports.arrayReduce = function (arrFront, reduceArr, key) {
} }
return arrFront; return arrFront;
}; };
exports.arrayReduce = arrayReduce;
//判断数组中 是否存在 某个值的对象记录 如不存在返回 - 1,存在返回相应的 序列 //判断数组中 是否存在 某个值的对象记录 如不存在返回 - 1,存在返回相应的 序列
exports.arrayExistObj = function (arr, key, value) {
function arrayExistObj(arr, key, value) {
let ret = - 1 let ret = - 1
for(let i = 0;i<arr.length;i++){
if(arr[i][key] == value){
for (let i = 0; i < arr.length; i++) {
if (arr[i][key] == value) {
ret = i ret = i
break break
} }
} }
return ret return ret
}
};
exports.arrayExistObj = arrayExistObj;
//根据身份证号判断出生日期(yyyy-MM-DD),当前年龄与性别 粗犷式,不精确判断闰年平年 //根据身份证号判断出生日期(yyyy-MM-DD),当前年龄与性别 粗犷式,不精确判断闰年平年
exports.parseID = function (id) {
function parseID(id) {
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425; let yearInMs = 1000 * 60 * 60 * 24 * 365.2425;
let ret = { let ret = {
birthday:'',
age:-1,
sex:'U',
birthday: '',
age: -1,
sex: 'U',
} }
if(!id || id.length != 18) return ret
if(id.substring(10,12).parseInt > 12 || id.substring(10,12).parseInt == 0) return ret
if(id.substring(12,14).parseInt > 31 || id.substring(12,14).parseInt == 0) return ret
if (!id || id.length != 18) return ret
if (id.substring(10, 12).parseInt > 12 || id.substring(10, 12).parseInt == 0) return ret
if (id.substring(12, 14).parseInt > 31 || id.substring(12, 14).parseInt == 0) return ret
//出生日期 //出生日期
ret.birthday = id.substring(6,10) + '-' + id.substring(10,12) + '-' + id.substring(12,14)
ret.birthday = id.substring(6, 10) + '-' + id.substring(10, 12) + '-' + id.substring(12, 14)
//年龄 //年龄
ret.age = Math.floor((new Date().getTime() - new Date(ret.birthday).getTime())/yearInMs)
ret.age = Math.floor((new Date().getTime() - new Date(ret.birthday).getTime()) / yearInMs)
//奇数 男, 偶数 女 //奇数 男, 偶数 女
if(id.substring(16,17)%2 == 0){
if (id.substring(16, 17) % 2 == 0) {
ret.sex = 'F' ret.sex = 'F'
}else{
} else {
ret.sex = 'M' ret.sex = 'M'
} }
return ret return ret
}
};
exports.parseID = parseID;
//根据出生日期,计算当前年龄 粗犷式,不精确判断闰年平年 //根据出生日期,计算当前年龄 粗犷式,不精确判断闰年平年
exports.birthdayToAge = function (birthday) {
function birthdayToAge(birthday) {
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425; let yearInMs = 1000 * 60 * 60 * 24 * 365.2425;
//年龄 //年龄
return Math.floor((new Date().getTime() - new Date(birthday).getTime())/yearInMs)
}
return Math.floor((new Date().getTime() - new Date(birthday).getTime()) / yearInMs)
};
exports.birthdayToAge = birthdayToAge;
//分析身份证数据
function parsIcCardtoLocal(idNos, dictSex, dictNation) {
let local = deepCopy(idNos);
// {
// "Code": "Success",
// "Name": "刘滔",
// "Sex": "男",
// "Nation": "汉",
// "Birthday": "1986-01-22",
// "Address": "湖南省长沙县春华镇九木村新元组367号",
// "DepartmentIC": "长沙县公安局",
// "StartDateIC": "2019-11-25",
// "EndDateIC": "2039-11-25",
// "IDCode": "430121198601223693",
// "Photo": ""
// }
console.log(local, dictSex, dictNation)
let lfind = -1;
lfind = arrayExistObj(dictSex, 'displayName', local.Sex)
console.log(lfind,local.Sex)
if (lfind > -1) local.sexId = dictSex[lfind].id;
lfind = arrayExistObj(dictNation, 'displayName', local.Nation + '族')
console.log(lfind,local.Nation)
if (lfind > -1) local.nationId = dictNation[lfind].nationId;
local.birthDate = new Date(local.Birthday)
local.age = birthdayToAge(local.Birthday)
return local
};
exports.parsIcCardtoLocal = parsIcCardtoLocal;
function photoParse(photo) {
//console.log(sysConfig,photo)
let lphoto = '' //data:image、UpLoad/、/pic/Photo.jpg
if (photo.indexOf("UpLoad/") > - 1) {
lphoto = sysConfig.apiurl + '/' + photo + '?' + new Date().getTime()
} else {
lphoto = photo
}
//console.log(lphoto)
return lphoto
};
exports.photoParse = photoParse;
async function savePeoplePhoto(peopleId, photoBase64) {
let lres = { code: -1, msg: '' }
if (!peopleId) return { code: -1, msg: '人员ID不能为空' }
if (!photoBase64 || photoBase64.indexOf('data:image') < 0) return { code: -1, msg: '图像数据不是合法的base64编码数据' }
let uploadPhoto = {
patientRegisterId: peopleId,
photo: photoBase64.split(",")[1],
};
try {
lres = await postapi(`/api/app/patient-register/up-load-img`, uploadPhoto)
let body = {
patientRegisterId: peopleId,
photo: lres.data,
}
await postapi(`/api/app/patient-register/update-photo`, body)
} catch (error) {
lres = { code: -1, msg: error }
}
return lres
};
exports.savePeoplePhoto = savePeoplePhoto;
Loading…
Cancel
Save