收费
@@ -364,23 +376,19 @@
查找: 条码号
-
+
档案号
-
+
姓名
-
+
手机号
-
+
@@ -438,7 +446,7 @@
-
@@ -463,7 +471,7 @@ import { mapState } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import mm from "../../utlis/mm";
-import { objCopy, setNull, dddw, parseID, birthdayToAge,deepCopy } from "../../utlis/proFunc";
+import { objCopy, setNull, dddw, parseID, birthdayToAge, deepCopy, arrayFilter } from "../../utlis/proFunc";
import Camera from "./Camera.vue";
import PatientRegisterItem from "./PatientRegisterItem.vue";
import LisRequest from "./LisRequest.vue";
@@ -481,8 +489,8 @@ export default {
return {
apiurl: mm.apiurl,
brushTimes: 0,
- payTypeFlag:'',
- peisid:null,
+ payTypeFlag: '',
+ peisid: null,
form: {
id: "", //id
patientId: "00000000-0000-0000-0000-000000000000", //档案号ID 选择了档案就传档案号,未选就传00000-0000...
@@ -491,7 +499,7 @@ export default {
customerOrgGroupId: null, //分组
medicalPackageId: null, //套餐
patientName: "", //姓名
- birthDate: "", //字符串 如:2012-01-29
+ birthDate: null, //日期型
sexId: "U", //性别 默认未知U
age: null, //年龄
jobCardNo: "", //工卡号
@@ -530,8 +538,10 @@ export default {
isNameHideBox: false, //隐藏姓名
isPhoneFollowBox: false, //电话随访
isLockBox: false, //是否锁住
+ customerOrgRegisterId: null,
+ isMaxMedicalTimes: 'N',
}, //单位 记录 目前新增与更新是一致
-
+ customerOrgRegisterList: [], //单位体检次数列表
defaultNull: [
"customerOrgId",
"customerOrgGroupId",
@@ -562,17 +572,18 @@ export default {
};
},
- created() {
+ created() {
this.peisid = window.sessionStorage.getItem('peisid');
- if(!this.form.id){
+ if (!this.form.id) {
this.form.organizationUnitId = this.peisid;
}
},
//挂载完成
mounted() {
- objCopy(this.formInitData, this.form);
+ objCopy(this.formInitData, this.form);
this.initBox();
+ this.getCustomerOrgRegisterList()
},
computed: {
@@ -583,6 +594,48 @@ export default {
console.log("this.form1", this.form);
},
+ //获取单位体检次数列表,并默认赋最后一次体检次数
+ async getCustomerOrgRegisterList() {
+ this.customerOrgRegisterList = []
+ if (this.form.customerOrgId == this.dict.personOrgId){
+ this.form.customerOrgRegisterId = null
+ return
+ }
+ try {
+ let res = await getapi(`/api/app/customer-org/parent/${this.form.customerOrgId}`);
+ let res1 = await getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${res.data}`);
+ this.customerOrgRegisterList = arrayFilter(res1.data, 'isComplete', 'N')
+ //要把已完成体检的次数去掉
+ if (this.customerOrgRegisterList.length > 0) {
+ this.form.customerOrgRegisterId = this.customerOrgRegisterList[this.customerOrgRegisterList.length - 1].id
+ //this.changeCustomerOrgGroupId()
+ this.changeMedicalTimes()
+ }
+ } catch (error) {
+ console.log(error)
+ }
+ },
+
+ //修改单位体检次数
+ changeMedicalTimes() {
+
+ this.form.customerOrgGroupId = null
+ this.changeCustomerOrgGroupId()
+
+ //获取体检次数下的分组
+ this.getCustomerOrgGroup(this.form.customerOrgRegisterId)
+ },
+
+ //获取体检次数下的分组
+ getCustomerOrgGroup(customerOrgRegisterId){
+ this.patientRegister.customerOrgGroup = []
+ getapi(`/api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${customerOrgRegisterId}`).then(res => {
+ if (res.code != - 1) {
+ this.patientRegister.customerOrgGroup = res.data.items;
+ }
+ })
+ },
+
//修改出生日期
changeBirthDate() {
this.form.age = birthdayToAge(this.form.birthDate)
@@ -592,14 +645,14 @@ export default {
changeIdNo() {
let ret = parseID(this.form.idNo)
if (ret.age != -1) {
- this.form.birthDate = ret.birthday
+ this.form.birthDate = new Date(ret.birthday)
this.form.age = ret.age
this.form.sexId = ret.sex
}
},
//分组改变时触发
- changeCustomerOrgGroupId() {
+ changeCustomerOrgGroupId() {
this.patientRegister.customerOrgGroupChange++;
if (this.form.id) this.Onsubmit('form', false);
},
@@ -645,13 +698,26 @@ export default {
this.form.patientName = this.patientChoosed.displayName;
this.form.sexId = this.patientChoosed.sexId;
this.form.maritalStatusId = this.patientChoosed.maritalStatusId;
- this.form.birthDate = this.patientChoosed.birthDate;
+ this.form.birthDate = new Date(this.patientChoosed.birthDate);
this.form.nationId = this.patientChoosed.nationId;
this.form.idNo = this.patientChoosed.idNo;
this.form.telephone = this.patientChoosed.telephone;
this.form.mobileTelephone = this.patientChoosed.mobileTelephone;
this.form.patientNo = this.patientChoosed.patientNo;
this.form.medicalTimes = this.patientChoosed.medicalTimes + 1;
+
+ if (this.form.birthDate) {
+ this.form.age = birthdayToAge(this.form.birthDate)
+ }
+
+ if (this.form.idNo) {
+ let ret = parseID(this.form.idNo)
+
+ if (!this.form.birthDate) this.form.birthDate = new Date(ret.birthday)
+ if (!this.form.age) this.form.age = ret.age
+ if (!this.form.sexId) this.form.age = ret.sex
+ }
+
},
ldddw(arrayData, key, value, display) {
@@ -664,39 +730,39 @@ export default {
changeBox(type) {
//赋值
- if(this.form[type + 'Box']){
+ if (this.form[type + 'Box']) {
this.form[type] = 'Y';
- }else{
+ } else {
this.form[type] = 'N';
}
},
-
- initBox(){
- if(this.form.isVip == 'Y'){
+
+ initBox() {
+ if (this.form.isVip == 'Y') {
this.form.isVipBox = true;
- }else{
+ } else {
this.form.isVipBox = false;
}
- if(this.form.isNameHide == 'Y'){
+ if (this.form.isNameHide == 'Y') {
this.form.isNameHideBox = true;
- }else{
+ } else {
this.form.isNameHideBox = false;
}
- if(this.form.isPhoneFollow == 'Y'){
+ if (this.form.isPhoneFollow == 'Y') {
this.form.isPhoneFollowBox = true;
- }else{
+ } else {
this.form.isPhoneFollowBox = false;
}
- if(this.form.isLock == 'Y'){
+ if (this.form.isLock == 'Y') {
this.form.isLockBox = true;
- }else{
+ } else {
this.form.isLockBox = false;
}
- if(!this.form.id){
+ if (!this.form.id) {
this.form.organizationUnitId = this.peisid;
}
},
@@ -735,8 +801,8 @@ export default {
if (this.form.id.length < 1) {
//id为空则新增
- console.log(`/api/app/patient-register/return-info`, body);
- postapi(`/api/app/patient-register/return-info`, body).then(
+ console.log(`/api/patientregister/createreturninfo`, body);
+ postapi(`/api/patientregister/createreturninfo`, body).then(
(res) => {
if (res.code == 1) {
//console.log('res',res)
@@ -756,9 +822,9 @@ export default {
}
);
} else {
- //id不为空则编辑
- console.log(`/api/app/patient-register?PatientRegisterId=${this.form.id}`, body);
- putapi(`/api/app/patient-register?PatientRegisterId=${this.form.id}`, body).then((res) => {
+ //id不为空则编辑 api/patientregister/updatepatientregister
+ console.log(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body);
+ postapi(`/api/patientregister/updatepatientregister?PatientRegisterId=${this.form.id}`, body).then((res) => {
if (res.code == 1) {
if (msgTip) this.$message.success("更新 操作成功");
this.patientRegister.query.times++;
@@ -1012,16 +1078,23 @@ export default {
this.patientRegister.mergeAsbitemVisble = true;
},
- toCharge(patientRegisterNo){
+ toCharge(patientRegisterNo) {
this.patientRegister.patientRegisterRd.patientRegisterNo = patientRegisterNo;
this.$router.push({ path: "/charge" });
},
-
+
},
//监听事件
watch: {
+ "form.customerOrgId"(newVal, oldVal) {
+ //console.log('editTimes newVal:',newVal,' oldVal:',oldVal)
+ if (newVal != oldVal) {
+ this.getCustomerOrgRegisterList()
+ }
+ },
+
//新增或编辑
"editTimes"(newVal, oldVal) {
//console.log('editTimes newVal:',newVal,' oldVal:',oldVal)
@@ -1045,9 +1118,11 @@ export default {
};