|
|
@@ -77,7 +77,16 @@
|
|
|
<el-checkbox v-model="queryParams.myCustomerFlag"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="已获取电话" prop="autoAddUser" label-width="100px">
|
|
|
- <el-checkbox v-model="queryParams.autoAddUser" />
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.autoAddUser"
|
|
|
+ placeholder="请选择"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 120px"
|
|
|
+ >
|
|
|
+ <el-option label="已获取" :value="1" />
|
|
|
+ <el-option label="未获取" :value="0" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="信息状态" prop="completeStatus">
|
|
|
<el-select
|
|
|
@@ -755,7 +764,7 @@
|
|
|
<el-dialog
|
|
|
title="认领客户"
|
|
|
:visible.sync="claimDialogVisible"
|
|
|
- width="450px"
|
|
|
+ width="700px"
|
|
|
append-to-body
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
|
@@ -787,6 +796,46 @@
|
|
|
<el-option label="已加" :value="1" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+
|
|
|
+ <!-- 新增四个文本域,至少填写一项 -->
|
|
|
+ <div style="border-top: 1px dashed #dcdfe6; margin: 15px 0; padding-top: 10px;">
|
|
|
+ <p style="color: #E6A23C; font-size: 13px; margin-bottom: 10px;">
|
|
|
+ <i class="el-icon-warning"></i> 以下四项至少填写一项
|
|
|
+ </p>
|
|
|
+ <el-form-item label="患者病情主诉" prop="patientMainComplaint">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="claimForm.patientMainComplaint"
|
|
|
+ placeholder="请输入患者病情主诉"
|
|
|
+ :rows="3"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="现病史" prop="presentIllness">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="claimForm.presentIllness"
|
|
|
+ placeholder="请输入现病史"
|
|
|
+ :rows="3"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="现用药情况" prop="currentMedication">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="claimForm.currentMedication"
|
|
|
+ placeholder="请输入现用药情况"
|
|
|
+ :rows="3"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="过敏史" prop="allergyHistory">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="claimForm.allergyHistory"
|
|
|
+ placeholder="请输入过敏史"
|
|
|
+ :rows="3"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
<p style="color: #909399; font-size: 12px; margin-top: 10px">
|
|
|
认领后,该客户将归属到您的账号下。
|
|
|
</p>
|
|
|
@@ -797,8 +846,7 @@
|
|
|
type="primary"
|
|
|
:loading="claimSubmitLoading"
|
|
|
@click="submitClaim"
|
|
|
- >确 认</el-button
|
|
|
- >
|
|
|
+ >确 认</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -1747,7 +1795,7 @@ export default {
|
|
|
myCustomerFlag: true,
|
|
|
sortField: null, //排序字段 (create_time / filing_time)
|
|
|
sortOrder: null, //排序方向 (asc / desc)
|
|
|
- autoAddUser: false,//自动添加的客户 默认不勾选
|
|
|
+ autoAddUser: null, // 已获取电话 默认不选
|
|
|
},
|
|
|
form: {},
|
|
|
rules: {
|
|
|
@@ -1812,7 +1860,14 @@ export default {
|
|
|
claimDialogVisible: false,
|
|
|
claimSubmitLoading: false,
|
|
|
currentClaimRow: null,
|
|
|
- claimForm: { claimNumber: "", kdzlAddWechatStatus: null },
|
|
|
+ claimForm: {
|
|
|
+ claimNumber: '',
|
|
|
+ kdzlAddWechatStatus: null,
|
|
|
+ patientMainComplaint: '',
|
|
|
+ presentIllness: '',
|
|
|
+ currentMedication: '',
|
|
|
+ allergyHistory: ''
|
|
|
+ },
|
|
|
claimRules: {
|
|
|
claimNumber: [
|
|
|
{ required: true, message: "请输入认领号码", trigger: "blur" },
|
|
|
@@ -2777,16 +2832,13 @@ export default {
|
|
|
this.handleQuery();
|
|
|
// 清空归属组别
|
|
|
this.queryParams.deptId = null;
|
|
|
- this.queryParams.autoAddUser = false; // 重置为未勾选
|
|
|
+ this.queryParams.autoAddUser = null; // 重置为未勾选
|
|
|
},
|
|
|
handleClaim(row) {
|
|
|
- // 先调用快捷判断接口
|
|
|
canClaimCustomer(row.id).then(response => {
|
|
|
- const flag = response.data; // 0 或 1
|
|
|
+ const flag = response.data;
|
|
|
if (flag === 1) {
|
|
|
- // 符合快捷认领 → 打开编辑弹窗(快捷模式)
|
|
|
this.isQuickClaimMode = true;
|
|
|
- // 获取客户详情填充到表单
|
|
|
getCustomer(row.id).then(res => {
|
|
|
this.form = res.data;
|
|
|
if (this.form.sex !== undefined && this.form.sex !== null) {
|
|
|
@@ -2795,40 +2847,62 @@ export default {
|
|
|
this.open = true;
|
|
|
this.title = "认领客户 - 请完善信息";
|
|
|
}).catch(() => {
|
|
|
- this.isQuickClaimMode = false; // 失败时重置
|
|
|
+ this.isQuickClaimMode = false;
|
|
|
this.$message.error('获取客户信息失败');
|
|
|
});
|
|
|
} else {
|
|
|
- // 不符合 → 走原有普通认领弹窗
|
|
|
this.isQuickClaimMode = false;
|
|
|
this.currentClaimRow = row;
|
|
|
- this.claimForm.claimNumber = '';
|
|
|
- this.claimForm.kdzlAddWechatStatus = null;
|
|
|
+ // 重置表单,包括新增字段
|
|
|
+ this.claimForm = {
|
|
|
+ claimNumber: '',
|
|
|
+ kdzlAddWechatStatus: null,
|
|
|
+ patientMainComplaint: '',
|
|
|
+ presentIllness: '',
|
|
|
+ currentMedication: '',
|
|
|
+ allergyHistory: ''
|
|
|
+ };
|
|
|
this.claimDialogVisible = true;
|
|
|
this.$nextTick(() => {
|
|
|
if (this.$refs.claimForm) this.$refs.claimForm.clearValidate();
|
|
|
});
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
- this.isQuickClaimMode = false; // 异常时重置
|
|
|
+ this.isQuickClaimMode = false;
|
|
|
this.$message.error(error.msg || '判断快捷认领失败');
|
|
|
});
|
|
|
},
|
|
|
submitClaim() {
|
|
|
this.$refs.claimForm.validate((valid) => {
|
|
|
if (!valid) return;
|
|
|
+
|
|
|
+ // 校验四个文本域至少填写一项
|
|
|
+ const { patientMainComplaint, presentIllness, currentMedication, allergyHistory } = this.claimForm;
|
|
|
+ const hasAny = [
|
|
|
+ patientMainComplaint,
|
|
|
+ presentIllness,
|
|
|
+ currentMedication,
|
|
|
+ allergyHistory
|
|
|
+ ].some(val => val && val.trim() !== '');
|
|
|
+
|
|
|
+ if (!hasAny) {
|
|
|
+ this.$message.error('患者病情主诉、现病史、现用药情况、过敏史至少填写一项');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!this.currentClaimRow || !this.currentClaimRow.id) {
|
|
|
- this.$message.error("客户信息异常,请刷新后重试");
|
|
|
+ this.$message.error('客户信息异常,请刷新后重试');
|
|
|
this.claimDialogVisible = false;
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
this.claimSubmitLoading = true;
|
|
|
getCompanyUserAndDoctor()
|
|
|
.then((res) => {
|
|
|
const userData = res.data;
|
|
|
if (!userData || !userData.doctorId) {
|
|
|
- this.$message.error("未找到绑定医生,无法认领");
|
|
|
- throw new Error("未找到绑定医生");
|
|
|
+ this.$message.error('未找到绑定医生,无法认领');
|
|
|
+ throw new Error('未找到绑定医生');
|
|
|
}
|
|
|
const claimParams = {
|
|
|
id: this.currentClaimRow.id,
|
|
|
@@ -2838,16 +2912,20 @@ export default {
|
|
|
doctorName: userData.doctorName,
|
|
|
claimPhone: this.claimForm.claimNumber,
|
|
|
kdzlAddWechatStatus: this.claimForm.kdzlAddWechatStatus,
|
|
|
+ patientMainComplaint: this.claimForm.patientMainComplaint,
|
|
|
+ presentIllness: this.claimForm.presentIllness,
|
|
|
+ currentMedication: this.claimForm.currentMedication,
|
|
|
+ allergyHistory: this.claimForm.allergyHistory
|
|
|
};
|
|
|
return claimCustomer(claimParams);
|
|
|
})
|
|
|
.then(() => {
|
|
|
- this.$message.success("认领成功");
|
|
|
+ this.$message.success('认领成功');
|
|
|
this.claimDialogVisible = false;
|
|
|
this.getList();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- const errorMsg = err?.message || err?.msg || "认领失败,请稍后重试";
|
|
|
+ const errorMsg = err?.message || err?.msg || '认领失败,请稍后重试';
|
|
|
this.$message.error(errorMsg);
|
|
|
})
|
|
|
.finally(() => {
|