|
|
@@ -120,7 +120,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="接诊医生" prop="receptionDoctor" style="flex: 1; margin-bottom: 0;">
|
|
|
- <el-input v-model="form.receptionDoctor" placeholder="请输入接诊医生" />
|
|
|
+ <el-input v-model="form.receptionDoctor" placeholder="请输入接诊医生" disabled/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="所在市" prop="city" style="flex: 2; margin-bottom: 0;">
|
|
|
<el-input v-model="form.city" placeholder="请输入所在市" />
|
|
|
@@ -187,7 +187,7 @@
|
|
|
<input type="hidden" v-model="form.doctorSignature" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执业证编号" prop="practiceCertificateNo" style="flex: 1; margin-bottom: 0;">
|
|
|
- <el-input v-model="form.practiceCertificateNo" placeholder="请输入执业证编号" />
|
|
|
+ <el-input v-model="form.practiceCertificateNo" placeholder="请输入执业证编号" disabled />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
@@ -224,6 +224,22 @@ export default {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
+ const validatePhone = (rule, value, callback) => {
|
|
|
+ if (!value) {
|
|
|
+ callback(new Error('电话号码不能为空'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const phone = String(value).trim();
|
|
|
+ if (!/^\d{11}$/.test(phone)) {
|
|
|
+ callback(new Error('电话号码必须为11位数字'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!/^1[3-9]\d{9}$/.test(phone)) {
|
|
|
+ callback(new Error('请输入有效的手机号码(1开头,第二位3-9)'));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ callback();
|
|
|
+ };
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
@@ -263,7 +279,10 @@ export default {
|
|
|
{ required: true, message: "年龄不能为空", trigger: "blur" },
|
|
|
{ validator: validateAge, trigger: "blur" }
|
|
|
],
|
|
|
- phone: [{ required: true, message: "电话不能为空", trigger: "blur" }],
|
|
|
+ phone: [
|
|
|
+ { required: true, message: "电话不能为空", trigger: "blur" },
|
|
|
+ { validator: validatePhone, trigger: "blur" }
|
|
|
+ ],
|
|
|
receptionTime: [{ required: true, message: "接诊时间不能为空", trigger: "blur" }],
|
|
|
receptionDoctor: [{ required: true, message: "接诊医生不能为空", trigger: "blur" }],
|
|
|
city: [{ required: true, message: "所在市不能为空", trigger: "blur" }],
|
|
|
@@ -275,6 +294,7 @@ export default {
|
|
|
syndromeRegulation: [{ required: true, message: "证型调理不能为空", trigger: "blur" }],
|
|
|
treatmentOpinion: [{ required: true, message: "诊疗意见不能为空", trigger: "blur" }],
|
|
|
precautions: [{ required: true, message: "注意禁忌不能为空", trigger: "blur" }],
|
|
|
+ practiceCertificateNo: [{ required: true, message: "执业证号不能为空", trigger: "blur" }],
|
|
|
},
|
|
|
// 性别选项
|
|
|
sexOptions: [
|
|
|
@@ -287,10 +307,12 @@ export default {
|
|
|
doctorId: null,
|
|
|
doctorName: '',
|
|
|
practiseCode: '',
|
|
|
+ certificateCode: '',
|
|
|
signUrl: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
created() {
|
|
|
this.getList()
|
|
|
this.fetchDoctorInfo();
|
|
|
@@ -305,6 +327,7 @@ export default {
|
|
|
doctorId: doc.doctorId,
|
|
|
doctorName: doc.doctorName || '',
|
|
|
practiseCode: doc.practiseCode || '',
|
|
|
+ certificateCode: doc.certificateCode || '',
|
|
|
signUrl: doc.signUrl || ''
|
|
|
};
|
|
|
}
|
|
|
@@ -382,11 +405,20 @@ export default {
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
+
|
|
|
+ // 获取执业证编号:优先 practiseCode,其次 certificateCode
|
|
|
+ let practiceNo = this.currentDoctor.practiseCode || this.currentDoctor.certificateCode;
|
|
|
+ if (!practiceNo) {
|
|
|
+ this.$modal.msgError("执业证号不可为空!请医生完善自身信息!");
|
|
|
+ return; // 阻止打开弹窗
|
|
|
+ }
|
|
|
+
|
|
|
// 回填当前医生信息
|
|
|
this.form.receptionDoctor = this.currentDoctor.doctorName;
|
|
|
- this.form.practiceCertificateNo = this.currentDoctor.practiseCode;
|
|
|
+ this.form.practiceCertificateNo = practiceNo;
|
|
|
this.form.doctorSignature = this.currentDoctor.signUrl;
|
|
|
this.form.doctorId = this.currentDoctor.doctorId;
|
|
|
+
|
|
|
this.open = true;
|
|
|
this.title = "添加患者信息";
|
|
|
},
|
|
|
@@ -408,30 +440,31 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updatePatientInfo(this.form).then(() => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
+ const apiCall = this.form.id != null ? updatePatientInfo(this.form) : addPatientInfo(this.form);
|
|
|
+ apiCall.then(() => {
|
|
|
+ this.$message.success(this.form.id != null ? "修改成功" : "新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
this.getList();
|
|
|
});
|
|
|
- } else {
|
|
|
- addPatientInfo(this.form).then(() => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
+ }).catch(error => {
|
|
|
+ this.$message.error(error.message || "操作失败");
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids.join(",");
|
|
|
- this.$modal.confirm('是否确认删除该患者信息?').then(function() {
|
|
|
+ this.$confirm('是否确认删除该患者信息?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
return delPatientInfo(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
+ this.$message.success("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|