|
|
|
@ -846,17 +846,6 @@ export default { |
|
|
|
// isDoctor: '0:标准人员登记/1:医生诊台登记(可修改单位)' |
|
|
|
props: ['isDoctor', 'patientRegisterId', 'editTimes', 'refreshRegister', 'refFuncSetData'], |
|
|
|
data() { |
|
|
|
var validateMobileTelephone = (rule, value, callback) => { |
|
|
|
if (value) { |
|
|
|
if (!isValidMobileNumber(value)) { |
|
|
|
callback(new Error('请填写正确的手机号!')); |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
} |
|
|
|
}; |
|
|
|
return { |
|
|
|
pagePriv: { |
|
|
|
routeUrlorPageName: 'PatientRegisterEdit', //当前页面归属路由或归属页面权限名称 |
|
|
|
@ -1041,6 +1030,8 @@ export default { |
|
|
|
customerOrgAll: [], |
|
|
|
customerOrgRegisterList: [], //当前体检次数集合 |
|
|
|
customerOrgRegister: {}, // 当前选择体检次数 |
|
|
|
|
|
|
|
hc_warn_mode: '1', //0-仅提醒;1-提醒并决择;2-有互斥项目时不允许保存 |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -1128,6 +1119,18 @@ export default { |
|
|
|
// console.log('form', this.form) |
|
|
|
}, |
|
|
|
|
|
|
|
validateMobileTelephone(rule, value, callback) { |
|
|
|
if (value) { |
|
|
|
if (!isValidMobileNumber(value)) { |
|
|
|
callback(new Error('请填写正确的手机号!')); |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//数据初始化 |
|
|
|
dictInit() { |
|
|
|
// 获取系统参数 -- 职业病 体检类别编号 |
|
|
|
@ -1145,6 +1148,26 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 获取系统参数 -- 人员登记必填列 |
|
|
|
postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: 'patient_register_required_field' }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
try { |
|
|
|
let masterCols = JSON.parse(res.data) |
|
|
|
let cols = Object.keys(masterCols) |
|
|
|
cols.forEach(key => { |
|
|
|
if (!this.rules[key]) { |
|
|
|
this.rules[key] = [{ |
|
|
|
required: true, message: `请填写${masterCols[key]}`, trigger: "blur" |
|
|
|
}] |
|
|
|
} |
|
|
|
}); |
|
|
|
} catch (error) { |
|
|
|
console.error(error) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
//性别(仅档案用) |
|
|
|
getapi("/api/app/sex").then((res) => { |
|
|
|
if (res.code == 1) { |
|
|
|
@ -1933,12 +1956,22 @@ export default { |
|
|
|
//提交 |
|
|
|
btnSubmit(formName, msgTip) { |
|
|
|
//console.log('btnSubmit,formName,form', formName, JSON.stringify(this.form)) |
|
|
|
console.log('this.rules', this.rules) |
|
|
|
this.$refs[formName].validate((valid, fields) => { |
|
|
|
// console.log('fields', fields) |
|
|
|
if (!valid) { |
|
|
|
this.$message.warning({ showClose: true, message: fields[Object.keys(fields)[0]][0].message }); |
|
|
|
return false |
|
|
|
} |
|
|
|
// 手机号必填时,再验证手机号是否合法 |
|
|
|
if (this.rules['mobileTelephone']) { |
|
|
|
if (!isValidMobileNumber(this.form['mobileTelephone'])) { |
|
|
|
this.$message.warning({ showClose: true, message: '请填写正确的手机号!' }); |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//console.log('btnSubmit1', formName) |
|
|
|
if (this.form.customerOrgId != this.dict.personOrgId) { |
|
|
|
if (!this.form.customerOrgRegisterId) { |
|
|
|
@ -2039,7 +2072,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
) |
|
|
|
.catch(err => { |
|
|
|
console.error(err) |
|
|
|
}) |
|
|
|
; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -2052,20 +2089,49 @@ export default { |
|
|
|
asbitemIds.push(e.asbitemId) |
|
|
|
}); |
|
|
|
|
|
|
|
let message = '' |
|
|
|
if (asbitemIds.length == 0) { |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
postapi('/api/app/AsbitemMutualExclusion/GetAsbitemIsMutualExclusion', { asbitemIds }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
if(res?.data?.message) this.$message.warning({ showClose: true, message: res.data.message }) |
|
|
|
if (res?.data?.message) message = res.data.message |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
resolve() |
|
|
|
if (message) { |
|
|
|
switch (this.hc_warn_mode) { |
|
|
|
case '1':'' |
|
|
|
this.$confirm(`${message} 是否继续?`, "提示", { |
|
|
|
confirmButtonText: "是", |
|
|
|
cancelButtonText: " 否 ", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
reject(message) |
|
|
|
// if (err == "cancel") { |
|
|
|
// console.log("已取消删除"); |
|
|
|
// } |
|
|
|
}); |
|
|
|
break; |
|
|
|
case '2': |
|
|
|
this.$message.error({ showClose: true, message }) |
|
|
|
reject(message) |
|
|
|
break; |
|
|
|
default: |
|
|
|
this.$message.warning({ showClose: true, message }) |
|
|
|
resolve() |
|
|
|
break; |
|
|
|
} |
|
|
|
} else { |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|