|
|
|
@ -899,7 +899,7 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
async created() { |
|
|
|
created() { |
|
|
|
//获取用户当前页面的权限 |
|
|
|
let userPriv = window.sessionStorage.getItem('userPriv') |
|
|
|
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName)) |
|
|
|
@ -929,7 +929,7 @@ export default { |
|
|
|
this.formInit = deepCopy(this.form) |
|
|
|
|
|
|
|
// 初始化字典数据 |
|
|
|
await this.dictInit() |
|
|
|
this.dictInit() |
|
|
|
}, |
|
|
|
|
|
|
|
//挂载完成 |
|
|
|
@ -982,17 +982,16 @@ export default { |
|
|
|
btnTest() { |
|
|
|
// console.log('form', this.form) |
|
|
|
}, |
|
|
|
|
|
|
|
//数据初始化 |
|
|
|
async dictInit() { |
|
|
|
try { |
|
|
|
dictInit() { |
|
|
|
|
|
|
|
let sysParmId = "patient_register_occ_check_id" |
|
|
|
let sysParm = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId }) |
|
|
|
if (sysParm.code > -1) { |
|
|
|
this.patient_register_occ_check_id = sysParm.data |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.log('sysParmId:patient_register_occ_check_id', error) |
|
|
|
} |
|
|
|
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) this.patient_register_occ_check_id = res.data |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//性别(仅档案用) |
|
|
|
getapi("/api/app/sex").then((res) => { |
|
|
|
@ -1203,7 +1202,8 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取登记信息 初始form表单数据 |
|
|
|
async initFormData(patientRegisterId) { |
|
|
|
initFormData(patientRegisterId) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
this.peisid = window.sessionStorage.getItem('peisid'); |
|
|
|
let customerOrgId, customerOrgName, customerOrgParentId |
|
|
|
if (this.patientRegister.query.customerOrgId) { |
|
|
|
@ -1224,22 +1224,29 @@ export default { |
|
|
|
this.form.customerOrgId = customerOrgId //体检单位 |
|
|
|
this.form.customerOrgParentId = customerOrgParentId //体检父单位 |
|
|
|
this.form.customerOrgName = customerOrgName |
|
|
|
this.handleFormData() |
|
|
|
this.completeFlag = '0' |
|
|
|
this.handleFormData().then(() => { |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
// let res = await getapi(`/api/app/patient-register/${patientRegisterId}`) |
|
|
|
postapi('/api/app/patientregister/getinfoorpatient', { patientRegisterId }).then(res => { |
|
|
|
postapi('/api/app/patientregister/getinfoorpatient', { patientRegisterId }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
// this.form = res.data 这种方式,会造成 checkbox 值变化不响应,故取消 |
|
|
|
this.form = Object.assign({}, this.form, res.data) |
|
|
|
this.completeFlag = this.form.completeFlag |
|
|
|
this.handleFormData() |
|
|
|
this.handleFormData().then(() => resolve()) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => resolve()) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleFormData() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
// 判断是否职业健康检查 |
|
|
|
this.changeMedicalTypeId(this.form.medicalTypeId) |
|
|
|
if (this.form.isPatientOccupationalDisease == 'Y') { |
|
|
|
@ -1258,8 +1265,14 @@ export default { |
|
|
|
|
|
|
|
// 单位/个人 的分组与套餐处理 |
|
|
|
this.changeCustomerOrgId(this.form.customerOrgId) |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
// 刷新明细项目(已登记) |
|
|
|
this.dataTransOpts.refresh.register_check_asbitem.OnlyRefreshAsbitem++ |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
@ -1279,37 +1292,27 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//选择单位 |
|
|
|
async changeCustomerOrgId(v) { |
|
|
|
//选择单位,并返回顶级单位 |
|
|
|
changeCustomerOrgId(v) { |
|
|
|
// 始终返回 reslove ,主要用于流程控制 |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
console.log('changeCustomerOrgId', v, this.form.customerOrgParentId) |
|
|
|
let customerOrgId = "", customerOrgParentId = "" |
|
|
|
if (Array.isArray(v) && v.length > 0) { |
|
|
|
customerOrgId = v[v.length - 1] |
|
|
|
customerOrgParentId = v[0] |
|
|
|
} else { |
|
|
|
customerOrgId = v // 后台顶级单位ID未获取正确(再获取一次) |
|
|
|
customerOrgParentId = await this.getParentCustomerOrgId(customerOrgId) |
|
|
|
// let pids = getTreePids(this.patientRegister.customerOrgTreeAll, "treeChildren", "parentId", "id", customerOrgId) |
|
|
|
// if (Array.isArray(pids) && pids.length > 0) { |
|
|
|
// if (pids.length == 1) { |
|
|
|
// customerOrgParentId = customerOrgId |
|
|
|
// } else { |
|
|
|
// customerOrgParentId = pids[1] |
|
|
|
// } |
|
|
|
// } |
|
|
|
} |
|
|
|
// 保留之前预选的单位 if (!this.preCustomerOrgId) |
|
|
|
this.preCustomerOrgId = customerOrgId |
|
|
|
|
|
|
|
|
|
|
|
if (customerOrgParentId) { |
|
|
|
if (customerOrgParentId == this.dict.personOrgId) { |
|
|
|
// 个人体检则 固定单位体检次数 |
|
|
|
this.form.customerOrgRegisterId = "00000000-0000-0000-0000-000000000001" |
|
|
|
} else { |
|
|
|
// 获取体检次数字典库 |
|
|
|
this.getParentCustomerOrgId(v) |
|
|
|
.then(res => { |
|
|
|
if (res) { |
|
|
|
customerOrgParentId = res |
|
|
|
// 获取并设置体检次数(个人的固定 "00000000-0000-0000-0000-000000000001" ),单位刷新分组字典 |
|
|
|
this.getCustomerOrgRegisterList(customerOrgParentId) |
|
|
|
} |
|
|
|
|
|
|
|
.then(() => { |
|
|
|
// 需要触发 修改 分组/套餐 顶级ID 没有变时,不改变套餐与分组 |
|
|
|
if (customerOrgParentId != this.form.customerOrgParentId) { |
|
|
|
this.form.customerOrgGroupId = null |
|
|
|
@ -1319,6 +1322,7 @@ export default { |
|
|
|
e.isBelongGroupPackage = 'N' |
|
|
|
}); |
|
|
|
|
|
|
|
// 如果是个人,则清除分组字典 |
|
|
|
if (customerOrgParentId == this.dict.personOrgId) { |
|
|
|
this.patientRegister.customerOrgGroup = [] |
|
|
|
} |
|
|
|
@ -1329,28 +1333,53 @@ export default { |
|
|
|
this.changeCustomerOrgGroupId() |
|
|
|
} |
|
|
|
} |
|
|
|
return resolve(customerOrgParentId) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
resolve(customerOrgParentId) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
resolve(customerOrgParentId) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取顶级单位ID |
|
|
|
async getParentCustomerOrgId(customerOrgId) { |
|
|
|
getParentCustomerOrgId(v) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
let customerOrgParentId = null |
|
|
|
if (!customerOrgId) return customerOrgParentId |
|
|
|
if (Array.isArray(v) && v.length > 1) { |
|
|
|
customerOrgParentId = v[0] |
|
|
|
return resolve(customerOrgParentId) |
|
|
|
} else { |
|
|
|
let customerOrgId = v |
|
|
|
if (Array.isArray(v) && v.length == 1) customerOrgId = v[0] |
|
|
|
if (!customerOrgId) return resolve(customerOrgParentId) |
|
|
|
if (typeof customerOrgId == 'string') { |
|
|
|
try { |
|
|
|
let res = await getapi(`/api/app/customer-org/parent/${customerOrgId}`) |
|
|
|
if (res.code != -1) customerOrgParentId = res.data |
|
|
|
} catch (error) { |
|
|
|
// console.log('获取顶级单位ID出错:', error) |
|
|
|
} |
|
|
|
getapi(`/api/app/customer-org/parent/${customerOrgId}`) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) customerOrgParentId = res.data |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
return resolve(customerOrgParentId) |
|
|
|
}) |
|
|
|
} else if (customerOrgId.length > 0) { |
|
|
|
customerOrgParentId = customerOrgId[0] |
|
|
|
return resolve(customerOrgParentId) |
|
|
|
} |
|
|
|
} |
|
|
|
return customerOrgParentId |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//获取单位体检次数 |
|
|
|
//获取并设置体检次数(个人的固定 "00000000-0000-0000-0000-000000000001" ),单位刷新分组字典 |
|
|
|
getCustomerOrgRegisterList(customerOrgParentId) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
if (customerOrgParentId == this.dict.personOrgId) { |
|
|
|
// 个人体检则 固定单位体检次数 |
|
|
|
this.form.customerOrgRegisterId = "00000000-0000-0000-0000-000000000001" |
|
|
|
return resolve() |
|
|
|
} else { |
|
|
|
//获取单位体检次数信息 |
|
|
|
getapi(`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgParentId}`) |
|
|
|
.then(res => { |
|
|
|
@ -1366,11 +1395,20 @@ export default { |
|
|
|
} |
|
|
|
// /api/app/customerorggroup/getlistinfilter?CustomerOrgRegisterId=${this.form.customerOrgRegisterId} |
|
|
|
this.patientRegister.customerOrgGroup = [] |
|
|
|
if (this.form.customerOrgRegisterId && this.form.customerOrgRegisterId != '00000000-0000-0000-0000-000000000001') return postapi('/api/app/CustomerOrgGroup/GetListForPatentRegisterByFilter', { customerOrgRegisterId: this.form.customerOrgRegisterId }) //获取单位分组 |
|
|
|
if (this.form.customerOrgRegisterId && this.form.customerOrgRegisterId != '00000000-0000-0000-0000-000000000001') { |
|
|
|
//获取单位分组 |
|
|
|
postapi('/api/app/CustomerOrgGroup/GetListForPatentRegisterByFilter', { customerOrgRegisterId: this.form.customerOrgRegisterId }) |
|
|
|
.then(res2 => { |
|
|
|
if (res2 && res2.code != -1) { |
|
|
|
this.patientRegister.customerOrgGroup = res2.data; |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
if (res && res.code != -1) { |
|
|
|
this.patientRegister.customerOrgGroup = res.data; |
|
|
|
}) |
|
|
|
} return |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -1904,7 +1942,7 @@ export default { |
|
|
|
}); |
|
|
|
this.form.poisonIds = poisonIds |
|
|
|
resolve('') |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
reject(res.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -2837,7 +2875,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 关闭预约窗口--人寿 (团检、个人都可以) |
|
|
|
async close_dialogWin_WebBookingMzak() { |
|
|
|
close_dialogWin_WebBookingMzak() { |
|
|
|
// console.log('this.dataTransOpts.tableS.appoint_patient_register',this.dataTransOpts.tableS.appoint_patient_register) |
|
|
|
// console.log('this.dataTransOpts.tableM.appoint_register_asbitem',this.dataTransOpts.tableM.appoint_register_asbitem) |
|
|
|
// 没有选中网上预约记录,直接返回,不做任何处理 |
|
|
|
@ -2849,13 +2887,16 @@ export default { |
|
|
|
this.patientRegister.query.customerOrgId = appoint_patient_register.customerOrgId |
|
|
|
this.patientRegister.query.CustomerOrgParentId = appoint_patient_register.customerOrgId |
|
|
|
this.form.customerOrgId = [appoint_patient_register.customerOrgId] //单位编号 默认个人 |
|
|
|
let customerOrgParentId = await this.getParentCustomerOrgId(appoint_patient_register.customerOrgId) |
|
|
|
this.form.customerOrgParentId = customerOrgParentId |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await this.initFormData(this.dataTransOpts.tableS.patient_register.id) |
|
|
|
this.form.customerOrgName = customerOrgParentId |
|
|
|
let customerOrgParentId = '' |
|
|
|
this.getParentCustomerOrgId(appoint_patient_register.customerOrgId) |
|
|
|
.then(res => { |
|
|
|
customerOrgParentId = res |
|
|
|
this.form.customerOrgParentId = customerOrgParentId |
|
|
|
return this.initFormData(this.dataTransOpts.tableS.patient_register.id) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
// this.form.customerOrgName = customerOrgParentId |
|
|
|
// "appointPatientRegisterId": "string", |
|
|
|
// "personId": "string", |
|
|
|
// "personName": "string", |
|
|
|
@ -2891,8 +2932,8 @@ export default { |
|
|
|
// 人寿接口,甲方需求:岗位数据导入人员类别 |
|
|
|
// personnelTypeId --> positionName |
|
|
|
// dict.personnelType" :key="item.id" :label="item.displayName" |
|
|
|
let lfind = arrayExistObj(this.dict.personnelType,'displayName',appoint_patient_register.positionName) |
|
|
|
if(lfind > -1) this.form.personnelTypeId = this.dict.personnelType[lfind].id |
|
|
|
let lfind = arrayExistObj(this.dict.personnelType, 'displayName', appoint_patient_register.positionName) |
|
|
|
if (lfind > -1) this.form.personnelTypeId = this.dict.personnelType[lfind].id |
|
|
|
|
|
|
|
|
|
|
|
console.log('this.form', JSON.stringify(this.form)) |
|
|
|
@ -2926,12 +2967,7 @@ export default { |
|
|
|
if (this.form.customerOrgGroupId) this.changeCustomerOrgGroupId() |
|
|
|
|
|
|
|
this.changeIdNo() // 触发身份证查询档案号 |
|
|
|
|
|
|
|
// |
|
|
|
setTimeout(() => { |
|
|
|
this.form.customerOrgGroupId = appoint_patient_register.customerOrgGroupId |
|
|
|
}, 500); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|