9 changed files with 581 additions and 239 deletions
-
17src/api/request.js
-
3src/components/itemSet/ReferenceRange.vue
-
170src/components/patientRegister/Camera.vue
-
503src/components/patientRegister/PatientRegisterEdit.vue
-
30src/components/patientRegister/PatientRegisterList.vue
-
14src/components/patientRegister/patientRegisterQuery.vue
-
23src/store/index.js
-
6src/utlis/proFunc.js
-
54src/views/customerOrg/patientRegister.vue
@ -0,0 +1,170 @@ |
|||
<template> |
|||
<div> |
|||
<el-button @click="handleOpen">照相机拍照</el-button> |
|||
<div class="public-mask mask-grey-bg" v-show="cameraOpen"> |
|||
<div class="mask-main camera-main"> |
|||
<div class="mask-title"> |
|||
<img src="../assets/images/icon_camera.png" class="title-icon" /> |
|||
<span>照相机拍照</span> |
|||
<img src="../assets/images/icon_close.png" class="title-close" @click="closeCameraMask" /> |
|||
</div> |
|||
<div class="camera-box"> |
|||
<div class="camera-left"> |
|||
<!-- 这里就是摄像头显示的画面 --> |
|||
<video id="videoCamera" width="100%" height="100%"></video> |
|||
</div> |
|||
<div class="camera-right"> |
|||
|
|||
<div class="camera-img-box"> |
|||
<div class="small-img"> |
|||
<!-- 这里是点击拍照显示的图片画面 --> |
|||
<img v-if="imgSrc" :src="imgSrc" style="width: 200px;height: 150px;" /> |
|||
<canvas id="canvasCamera" class="canvas" :width='videoWidth' :height='videoHeight' |
|||
style="display: none;"></canvas> |
|||
</div> |
|||
<div> |
|||
<!-- 点击拍照和保存按钮 --> |
|||
<el-button type="primary" class="save-camera-btn" icon="el-icon-camera" @click="drawImage" |
|||
style="margin-top: 10px;">拍照</el-button> |
|||
<el-button type="primary" class="save-camera-btn" icon="el-icon-check" |
|||
@click="uploadPicture">保存</el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</template> |
|||
<script> |
|||
export default { |
|||
name: "Index", |
|||
data() { |
|||
return { |
|||
/** 照相机弹窗模块-start */ |
|||
cameraOpen: false, |
|||
imgSrc: undefined, |
|||
os: false,//控制摄像头开关 |
|||
thisVideo: null, |
|||
thisContext: null, |
|||
thisCancas: null, |
|||
videoWidth: 800, |
|||
videoHeight: 600, |
|||
/** 照相机弹窗模块-end */ |
|||
} |
|||
}, |
|||
methods: { |
|||
/** 调用摄像头拍照-start*/ |
|||
// 打开照相机弹窗 |
|||
handleOpen() { |
|||
this.cameraOpen = true; |
|||
this.getCompetence(); |
|||
}, |
|||
// 调用摄像头权限 |
|||
getCompetence() { |
|||
//必须在model中render后才可获取到dom节点,直接获取无法获取到model中的dom节点 |
|||
this.$nextTick(() => { |
|||
const _this = this; |
|||
this.os = false;//切换成关闭摄像头 |
|||
this.thisCancas = document.getElementById('canvasCamera');//这里是需要截取的canvas的Id名称 |
|||
this.thisContext = this.thisCancas.getContext('2d'); |
|||
this.thisVideo = document.getElementById('videoCamera'); |
|||
// 旧版本浏览器可能根本不支持mediaDevices,我们首先设置一个空对象 |
|||
if (navigator.mediaDevices === undefined) { |
|||
navigator.menavigatordiaDevices = {} |
|||
} |
|||
// 一些浏览器实现了部分mediaDevices,我们不能只分配一个对象 |
|||
// 使用getUserMedia,因为它会覆盖现有的属性。 |
|||
// 这里,如果缺少getUserMedia属性,就添加它。 |
|||
if (navigator.mediaDevices.getUserMedia === undefined) { |
|||
navigator.mediaDevices.getUserMedia = function (constraints) { |
|||
// 首先获取现存的getUserMedia(如果存在) |
|||
let getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.getUserMedia; |
|||
// 有些浏览器不支持,会返回错误信息 |
|||
// 保持接口一致 |
|||
if (!getUserMedia) { |
|||
return Promise.reject(new Error('getUserMedia is not implemented in this browser')) |
|||
} |
|||
// 否则,使用Promise将调用包装到旧的navigator.getUserMedia |
|||
return new Promise(function (resolve, reject) { |
|||
getUserMedia.call(navigator, constraints, resolve, reject) |
|||
}) |
|||
} |
|||
} |
|||
const constraints = { |
|||
audio: false, |
|||
video: {width: _this.videoWidth, height: _this.videoHeight, transform: 'scaleX(-1)'} |
|||
}; |
|||
navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { |
|||
// 旧的浏览器可能没有srcObject |
|||
if ('srcObject' in _this.thisVideo) { |
|||
_this.thisVideo.srcObject = stream |
|||
} else { |
|||
// 避免在新的浏览器中使用它,因为它正在被弃用。 |
|||
_this.thisVideo.src = window.URL.createObjectURL(stream) |
|||
} |
|||
_this.thisVideo.onloadedmetadata = function (e) { |
|||
_this.thisVideo.play() |
|||
} |
|||
}).catch(err => { |
|||
this.$notify({ |
|||
title: '警告', |
|||
message: '没有开启摄像头权限或浏览器版本不兼容.', |
|||
type: 'warning' |
|||
}); |
|||
}); |
|||
}); |
|||
}, |
|||
//绘制图片 |
|||
drawImage() { |
|||
// 点击,canvas画图 |
|||
this.thisContext.drawImage(this.thisVideo, 0, 0, this.videoWidth, this.videoHeight); |
|||
// 获取图片base64链接,展示到界面中的也是这个url地址 |
|||
this.imgSrc = this.thisCancas.toDataURL('image/png'); |
|||
}, |
|||
// 上传照相机图片 |
|||
uploadPicture() { |
|||
// 这里就调用上传图片接口即可 |
|||
|
|||
}, |
|||
//清空画布 |
|||
clearCanvas(id) { |
|||
let c = document.getElementById(id); |
|||
let cxt = c.getContext("2d"); |
|||
cxt.clearRect(0, 0, c.width, c.height); |
|||
}, |
|||
//重置画布 |
|||
resetCanvas() { |
|||
this.imgSrc = ""; |
|||
this.clearCanvas('canvasCamera'); |
|||
}, |
|||
//关闭摄像头 |
|||
stopNavigator() { |
|||
if (this.thisVideo && this.thisVideo !== null) { |
|||
this.thisVideo.srcObject.getTracks()[0].stop(); |
|||
this.os = true;//切换成打开摄像头 |
|||
} |
|||
}, |
|||
// 关闭照相机弹窗 |
|||
closeCameraMask() { |
|||
this.cameraOpen = false; // 关闭照相机弹窗 |
|||
this.resetCanvas(); // 重置画布 |
|||
this.stopNavigator(); // 关闭摄像头 |
|||
//this.getDetailList(); // 重新获取一下List,此方法不再书写 |
|||
}, |
|||
/** 调用摄像头拍照-end*/ |
|||
}, |
|||
} |
|||
|
|||
</script> |
|||
<style scoped> |
|||
.box { |
|||
display: flex; |
|||
} |
|||
|
|||
.listBtn { |
|||
margin-top: 10px; |
|||
}</style> |
|||
@ -1,338 +1,427 @@ |
|||
<template> |
|||
<div style="display:flex"> |
|||
<div> |
|||
<el-form ref="form" :model="customerOrg.customerOrgRd" label-width="110px" :rules="rules" size="medium"> |
|||
<el-form ref="form" :model="form" label-width="80px" :rules="rules" size="medium"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item label="单位名称" prop="displayName"> |
|||
<el-input v-model="customerOrg.customerOrgRd.displayName"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="单位名称" prop="customerOrgId"> |
|||
<el-cascader v-model="form.customerOrgId" :options="patientRegister.customerOrgTreeAll" |
|||
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops }" :show-all-levels="false" |
|||
disabled> |
|||
</el-cascader> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="简称" prop="shortName"> |
|||
<el-input v-model="customerOrg.customerOrgRd.shortName"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="条码号" prop="patientRegisterNo"> |
|||
<el-input v-model="form.patientRegisterNo" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="发票抬头" prop="invoiceName"> |
|||
<el-input v-model="customerOrg.customerOrgRd.invoiceName"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="档案号" prop="patientId"> |
|||
<el-input v-model="form.patientId" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="上级单位" prop="parentId"> |
|||
<el-cascader v-model="customerOrg.customerOrgRd.parentId" :options="customerOrg.customerOrgTree" :props="{ checkStrictly: true ,expandTrigger: 'hover',...customerOrg.treeprops}" |
|||
:show-all-levels="false" clearable filterable> |
|||
</el-cascader> |
|||
<el-col :span="6" /> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<el-form-item label="姓名" prop="patientName"> |
|||
<el-input v-model="form.patientName"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="性别" prop="sexId"> |
|||
<el-select v-model="form.sexId" placeholder="请选择"> |
|||
<el-option v-for="item in dict.sex" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="体检次数" prop="medicalTimes"> |
|||
<el-input v-model="form.medicalTimes" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6" /> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<el-form-item label="年龄" prop="age"> |
|||
<el-input v-model="form.age"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="联系电话" prop="telephone"> |
|||
<el-input v-model="customerOrg.customerOrgRd.telephone"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="出生日期" prop="birthDate"> |
|||
<el-date-picker v-model="form.birthDate" type="date" placeholder="出生日期" style="width:135px;" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="婚姻状况" prop="maritalStatusId"> |
|||
<el-select v-model="form.maritalStatusId" placeholder="请选择"> |
|||
<el-option v-for="item in dict.maritalStatus" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6" /> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="6"> |
|||
<el-form-item label="体检类别" prop="medicalTypeId"> |
|||
<el-select v-model="form.medicalTypeId" placeholder="请选择"> |
|||
<el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="传真" prop="fax"> |
|||
<el-input v-model="customerOrg.customerOrgRd.fax"></el-input> |
|||
|
|||
<el-col :span="6"> |
|||
<el-form-item label="工卡号" prop="jobCardNo"> |
|||
<el-input v-model="form.jobCardNo"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="邮政编码" prop="postalCode"> |
|||
<el-input v-model="customerOrg.customerOrgRd.postalCode"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="体检卡号" prop="medicalCardNo"> |
|||
<el-input v-model="form.medicalCardNo"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="地址" prop="address"> |
|||
<el-input v-model="customerOrg.customerOrgRd.address"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="职务" prop="jobPost"> |
|||
<el-input v-model="form.jobPost"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="开户银行" prop="bank"> |
|||
<el-input v-model="customerOrg.customerOrgRd.bank"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="职称" prop="jobTitle"> |
|||
<el-input v-model="form.jobTitle"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="银行账号" prop="accounts"> |
|||
<el-input v-model="customerOrg.customerOrgRd.accounts"></el-input> |
|||
|
|||
<el-col :span="6"> |
|||
<el-form-item label="介绍人" prop="salesman"> |
|||
<el-input v-model="form.salesman"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="单位性质" prop="orgTypeId"> |
|||
<el-select v-model="customerOrg.customerOrgRd.orgTypeId" placeholder="请选择" filterable> |
|||
<el-option v-for="item in data.customerOrgType" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="性激素期" prop="sexHormoneTermId"> |
|||
<el-select v-model="form.sexHormoneTermId" placeholder="请选择" filterable clearable> |
|||
<el-option v-for="item in dict.sexHormoneTerm" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="单位简码" prop="simpleCode"> |
|||
<el-input v-model="customerOrg.customerOrgRd.simpleCode" placeholder="由系统自动生成" disabled></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="是否VIP" prop="isVip"> |
|||
<el-radio v-model="form.isVip" label="Y">是</el-radio> |
|||
<el-radio v-model="form.isVip" label="N">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
|
|||
<el-col :span="6"> |
|||
<el-form-item label="电话随访" prop="isPhoneFollow"> |
|||
<el-radio v-model="form.isPhoneFollow" label="Y">是</el-radio> |
|||
<el-radio v-model="form.isPhoneFollow" label="N">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="隐藏姓名" prop="isNameHide"> |
|||
<el-radio v-model="form.isNameHide" label="Y">是</el-radio> |
|||
<el-radio v-model="form.isNameHide" label="N">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="是否锁住" prop="isLock"> |
|||
<el-radio v-model="form.isLock" label="Y">是</el-radio> |
|||
<el-radio v-model="form.isLock" label="N">否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="体检开始" prop="isMedicalStart"> |
|||
<el-radio v-model="form.isMedicalStart" label="Y" disabled>是</el-radio> |
|||
<el-radio v-model="form.isMedicalStart" label="N" disabled>否</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="6"> |
|||
<el-form-item label="体检中心" prop="organizationUnitId"> |
|||
<el-select v-model="customerOrg.customerOrgRd.organizationUnitId" placeholder="请选择" filterable> |
|||
<el-option v-for="item in data.organizationdata" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
<el-select v-model="form.organizationUnitId" placeholder="请选择" filterable> |
|||
<el-option v-for="item in dict.organization" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="customerOrg.customerOrgRd.remark"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="分组" prop="customerOrgGroupId"> |
|||
<el-select v-model="form.customerOrgGroupId" placeholder="请选择" filterable clearable |
|||
:disabled="form.customerOrgId == '00000000-0000-0000-0000-000000000000' ? false : true"> |
|||
<el-option v-for="item in patientRegister.customerOrgGroup" :key="item.id" :label="item.displayName" |
|||
:value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="加锁" prop="isLock"> |
|||
<el-radio v-model="customerOrg.customerOrgRd.isLock" label="Y">是</el-radio> |
|||
<el-radio v-model="customerOrg.customerOrgRd.isLock" label="N">否</el-radio> |
|||
<el-col :span="6"> |
|||
<el-form-item label="套餐" prop="medicalPackageId"> |
|||
<el-select v-model="form.medicalPackageId" placeholder="请选择" filterable clearable |
|||
:disabled="form.customerOrgId == '00000000-0000-0000-0000-000000000000' ? true : false"> |
|||
<el-option v-for="item in dict.medicalPackage" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="状态" prop="isActive"> |
|||
<el-radio v-model="customerOrg.customerOrgRd.isActive" label="Y">启用</el-radio> |
|||
<el-radio v-model="customerOrg.customerOrgRd.isActive" label="N">停用</el-radio> |
|||
<el-col :span="6"> |
|||
<el-form-item label="完成标志" prop="completeFlag"> |
|||
<el-select v-model="form.completeFlag" placeholder="请选择" disabled> |
|||
<el-option v-for="item in dict.completeFlag" :key="item.id" :label="item.displayName" :value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="显示顺序" prop="displayOrder"> |
|||
<el-input v-model="customerOrg.customerOrgRd.displayOrder"></el-input> |
|||
<el-col :span="24"> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="请输入内容"></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- --> |
|||
<el-divider/> |
|||
<el-row> |
|||
<el-col :span="5"> |
|||
<el-col :span="6"> |
|||
<el-form-item label="创建者"> |
|||
<el-input v-model="customerOrg.customerOrgRd.creatorName" disabled></el-input> |
|||
<el-input v-model="form.creatorName" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="7"> |
|||
<el-form-item label="创建时间" style="margin-left: -5%"> |
|||
<el-input :value="customerOrg.customerOrgRd.creationTime | dateFormat" disabled style="width: 90%"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="创建时间"> |
|||
<el-input :value="form.creationTime | dateFormat" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="5"> |
|||
<el-form-item label="修改者" style="margin-left: -25%"> |
|||
<el-input v-model="customerOrg.customerOrgRd.creatorName" disabled></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="修改者"> |
|||
<el-input v-model="form.creatorName" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="7"> |
|||
<el-form-item label="修改时间" style="margin-left: -5%"> |
|||
<el-input :value="customerOrg.customerOrgRd.lastModificationTime | dateFormat" disabled style="width: 90%"></el-input> |
|||
<el-col :span="6"> |
|||
<el-form-item label="修改时间"> |
|||
<el-input :value="form.lastModificationTime | dateFormat" disabled></el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
|
|||
<el-image class="photo" src="https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg"> |
|||
<div slot="placeholder" class="image-slot"> |
|||
加载中<span class="dot">...</span> |
|||
</div> |
|||
</el-image> |
|||
</div> |
|||
<!-- 按钮区域 --> |
|||
<div style="margin-left: 10px;" width="150px"> |
|||
<div style="margin-left: 10px;" width="120px"> |
|||
<div class="btn"> |
|||
<el-button @click="" >读身份证</el-button> |
|||
<el-button @click="readIdCard">读身份证</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="success" @click="Onsubmit('form')" >保存</el-button> |
|||
<el-button type="success" @click="Onsubmit('form')">保存</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="primary" @click="" >拍照</el-button> |
|||
<el-button type="primary" @click="">拍照</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="primary" @click="" >申请单</el-button> |
|||
<el-button type="primary" @click="">申请单</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="primary" @click="">打条码</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="primary" @click="" >打指引单</el-button> |
|||
<el-button type="primary" @click="">打指引单</el-button> |
|||
</div> |
|||
<div class="btn"> |
|||
<el-button type="primary" @click="" >复制新增</el-button> |
|||
<el-button type="primary" @click="">复制新增</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
|
|||
import { mapState,mapMutations } from 'vuex' |
|||
import moment from 'moment'; |
|||
import { mapState } from 'vuex' |
|||
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|||
import { tcdate } from '../../utlis/proFunc' |
|||
import { tcdate, objCopy } from '../../utlis/proFunc' |
|||
|
|||
export default { |
|||
components: { |
|||
|
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
data: { |
|||
|
|||
data: { |
|||
|
|||
organizationdata: [], //体检中心数据 |
|||
customerOrgType:[], //单位类别 |
|||
customerOrgType: [], //单位类别 |
|||
}, |
|||
pojo:{ |
|||
displayName: "string", |
|||
shortName: "string", |
|||
invoiceName: "string", |
|||
parentId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|||
telephone: "string", |
|||
fax: "string", |
|||
postalCode: "string", |
|||
address: "string", |
|||
bank: "string", |
|||
accounts: "string", |
|||
orgTypeId: "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|||
remark: "string", |
|||
isLock: "N", |
|||
isActive: "Y", |
|||
organizationUnitId: "3fa85f64-5717-4562-b3fc-2c963f66afa6" |
|||
}, //单位 记录 目前新增与更新是一致 |
|||
|
|||
|
|||
form: { |
|||
id: '', //id |
|||
patientId: '00000000-0000-0000-0000-000000000000', //档案号ID 选择了档案就传档案号,未选就传00000-0000... |
|||
customerOrgId: null, //单位编号 |
|||
customerOrgGroupId: null, //分组 |
|||
medicalPackageId: null,//套餐 |
|||
patientName: '', //姓名 |
|||
birthDate: '', //字符串 如:2012-01-29 |
|||
sexId: 'U', //性别 默认未知U |
|||
age: null, //年龄 |
|||
jobCardNo: '', //工卡号 |
|||
medicalCardNo: '', //体检卡号 |
|||
maritalStatusId: 'U', //婚姻状况 默认未知 |
|||
medicalTypeId: null, //体检类别 |
|||
personnelTypeId: null, //人员类别 |
|||
jobPost: '', //职务 |
|||
jobTitle: '', //职称 |
|||
photo: '', //照片 |
|||
salesman: '', //介绍人 |
|||
sexHormoneTermId: null, //性激素期限 |
|||
isNameHide: 'N', //隐藏姓名 |
|||
isPhoneFollow: 'N', //电话随访 |
|||
isVip: 'N', //vip客户 |
|||
remark: '', // |
|||
isLock: 'N', //是否锁住 |
|||
completeFlag: '1', //完成标志 0:预登记,1:未检,2:部份已检,3:已总检 【创建编辑时不操作】 |
|||
isMedicalStart: 'N', //体检开始标志 【创建编辑时不操作】 |
|||
patientRegisterNo: '', //条码号 【创建编辑时不操作】 |
|||
medicalTimes: 1, //条码号 【创建编辑时不操作】 |
|||
organizationUnitId: null //体检中心 |
|||
}, //单位 记录 目前新增与更新是一致 |
|||
|
|||
|
|||
rules: { |
|||
displayName: [ |
|||
{ required: true, message: "请输入名称", trigger: "blur" }, |
|||
], |
|||
shortName: [ |
|||
{ required: true, message: "请输入简写", trigger: "blur" }, |
|||
], |
|||
orgTypeId:[ |
|||
{ required: true, message: "请输入单位性质"}, |
|||
], |
|||
organizationUnitId: [ |
|||
{ required: true, message: "请输入体检中心", trigger: "blur" }, |
|||
], |
|||
displayOrder: [ |
|||
{ required: true, message: "请输入显示顺序", trigger: "blur" }, |
|||
patientName: [ |
|||
{ required: true, message: "请输入姓名", trigger: "blur" }, |
|||
], |
|||
}, |
|||
|
|||
isshow: false, |
|||
}; |
|||
}, |
|||
|
|||
created() { |
|||
|
|||
|
|||
}, |
|||
|
|||
//挂载完成 |
|||
mounted() { |
|||
|
|||
|
|||
//获取体中心字典数据 |
|||
this.getoraniztion(); |
|||
|
|||
//获取单位类别列表 |
|||
this.getOrgType() |
|||
|
|||
//表单赋值 |
|||
//console.log('mounted this.patientRegister.patientRegisterRd',this.patientRegister.patientRegisterRd) |
|||
objCopy(this.patientRegister.patientRegisterRd, this.form) |
|||
//console.log('mounted this.form',this.form) |
|||
}, |
|||
|
|||
computed:{ |
|||
...mapState(['customerOrg']), |
|||
computed: { |
|||
...mapState(['dict', 'patientRegister', 'customerOrg']), |
|||
}, |
|||
methods: { |
|||
|
|||
...mapMutations(['setData']), |
|||
//获取组织体检中心数据 |
|||
getoraniztion() { |
|||
getapi("/api/app/organization-units/organization-unit-by-is-peis").then( |
|||
(res) => { |
|||
this.data.organizationdata = res.data; |
|||
} |
|||
); |
|||
readIdCard() { |
|||
console.log('this.form1', this.form) |
|||
}, |
|||
|
|||
//获取单位类别列表 |
|||
getOrgType() { |
|||
getapi("/api/app/customer-org-type/in-filter").then((res) => { |
|||
this.data.customerOrgType = res.data.items; |
|||
}); |
|||
}, |
|||
|
|||
//更新获取单位树节点数据 |
|||
getCustomerOrgTree(){ |
|||
getapi("/api/app/customer-org/by-code-all").then( |
|||
(res) => { |
|||
//customerOrgTree = res.data; |
|||
console.log('res.data',res.data) |
|||
this.setData({ key: 'customerOrg.customerOrgTree', value: res.data}) |
|||
tcdate(this.customerOrg.customerOrgTree) |
|||
} |
|||
); |
|||
}, |
|||
|
|||
//提交 |
|||
Onsubmit(formName) { |
|||
console.log('vuex data',this.customerOrg.customerOrgRd) |
|||
let vpojo = this.customerOrg.customerOrgRd |
|||
this.$refs[formName].validate((valid) => { |
|||
if (valid) { |
|||
//赋值 |
|||
this.pojo = { |
|||
displayName: vpojo.displayName, |
|||
shortName: vpojo.shortName, |
|||
invoiceName: vpojo.invoiceName, |
|||
parentId: vpojo.parentId, |
|||
telephone: vpojo.telephone, |
|||
fax: vpojo.fax, |
|||
postalCode: vpojo.postalCode, |
|||
address: vpojo.address, |
|||
bank: vpojo.bank, |
|||
accounts: vpojo.accounts, |
|||
orgTypeId: vpojo.orgTypeId, |
|||
remark: vpojo.remark, |
|||
isLock: vpojo.isLock, |
|||
isActive: vpojo.isActive, |
|||
organizationUnitId: vpojo.organizationUnitId |
|||
} |
|||
console.log('pojo',this.pojo) |
|||
if(this.customerOrg.customerOrgRd.id.length < 1){ |
|||
//id为空则新增 |
|||
postapi(`/api/app/customer-org`, this.pojo).then( |
|||
(res) => { |
|||
this.$message.success("创健 操作成功"); |
|||
this.setData({ key: 'customerOrg.customerOrgRd', value: res}) |
|||
this.customerOrg.customerOrgId = res.id |
|||
this.getCustomerOrgTree() |
|||
if (valid) { |
|||
//赋值 |
|||
let body = {...this.form} |
|||
|
|||
} |
|||
); |
|||
delete body.id |
|||
delete body.patientRegisterNo |
|||
delete body.medicalTimes |
|||
delete body.completeFlag |
|||
delete body.isMedicalStart |
|||
|
|||
}else{ |
|||
//id不为空则编辑 |
|||
putapi(`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`, this.pojo).then( |
|||
(res) => { |
|||
this.$message.success("更新 操作成功"); |
|||
this.getCustomerOrgTree() |
|||
delete body.customerOrgGroupId |
|||
delete body.medicalPackageId |
|||
|
|||
//日期转换 |
|||
console.log('body.birthDate',body.birthDate) |
|||
if(body.birthDate){ |
|||
body.birthDate = moment(new Date(body.birthDate)).format('yyyy-MM-DD') |
|||
} |
|||
console.log('body.birthDate',body.birthDate) |
|||
//moment(pub.dateAddSeconds(new Date('2022-12-09T02:39:33.983Z'),60*60)).format('yyyyMMDDHHmmssSSS') |
|||
|
|||
console.log('this.form.id',this.form.id) |
|||
console.log('body',body) |
|||
if (this.form.id.length < 1) { |
|||
//id为空则新增 |
|||
|
|||
postapi(`/api/app/patient-register`, body).then( |
|||
(res) => { |
|||
if(res.code == 1){ |
|||
this.$message.success("创健 操作成功"); |
|||
this.patientRegister.patientRegisterId = res.id |
|||
this.patientRegister.patientRegisterRd = res |
|||
} |
|||
); |
|||
} |
|||
} |
|||
); |
|||
|
|||
} else { |
|||
alert('未通过数据校验'); |
|||
return false; |
|||
//id不为空则编辑 |
|||
putapi(`/api/app/patient-register/${this.form.id}`, body).then( |
|||
(res) => { |
|||
this.$message.success("更新 操作成功"); |
|||
objCopy(this.patientRegister.patientRegisterRd,this.form) |
|||
} |
|||
); |
|||
} |
|||
}); |
|||
|
|||
} else { |
|||
alert('未通过数据校验'); |
|||
return false; |
|||
} |
|||
}); |
|||
|
|||
}, |
|||
//新增弹框 |
|||
add() { |
|||
this.customerOrg.customerOrgId = '' |
|||
this.customerOrg.customerOrgRd = {id:'',isLock: 'N', |
|||
isActive: 'Y'} |
|||
this.customerOrg.customerOrgRd = { |
|||
id: '', isLock: 'N', |
|||
isActive: 'Y' |
|||
} |
|||
}, |
|||
|
|||
|
|||
//删除 |
|||
del(){ |
|||
del() { |
|||
deletapi(`/api/app/customer-org/${this.customerOrg.customerOrgRd.id}`).then( |
|||
(res) => { |
|||
this.$message.success("删除 操作成功"); |
|||
this.setData({ key: 'customerOrg.customerOrgRd', value:{id:''}}) |
|||
this.getCustomerOrgTree() |
|||
this.$message.success("删除 操作成功"); |
|||
this.setData({ key: 'customerOrg.customerOrgRd', value: { id: '' } }) |
|||
this.getCustomerOrgTree() |
|||
} |
|||
); |
|||
} |
|||
}, |
|||
|
|||
//监听事件 |
|||
watch: { |
|||
'patientRegister.patientRegisterRd.customerOrgId'(newVal, oldVal) { |
|||
if (newVal != oldVal) { |
|||
//console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId) |
|||
objCopy(this.patientRegister.patientRegisterRd, this.form) |
|||
} |
|||
}, |
|||
'patientRegister.patientRegisterRd.id'(newVal, oldVal) { |
|||
if (newVal != oldVal) { |
|||
//console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId) |
|||
objCopy(this.patientRegister.patientRegisterRd, this.form) |
|||
} |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style scoped> |
|||
.btn { |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
|||
.photo { |
|||
position: absolute; |
|||
top: 60px; |
|||
right: 150px; |
|||
width: 150px; |
|||
height: 180px; |
|||
}</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue