|
@@ -342,28 +342,31 @@
|
|
|
<span style="opacity:0">*</span>
|
|
<span style="opacity:0">*</span>
|
|
|
<div class="name">西医诊断:</div>
|
|
<div class="name">西医诊断:</div>
|
|
|
<div class="input">
|
|
<div class="input">
|
|
|
- <el-select
|
|
|
|
|
|
|
+ <div class="western-disease-tags" v-if="editData.westernDisease.length">
|
|
|
|
|
+ <el-tag
|
|
|
|
|
+ v-for="code in editData.westernDisease"
|
|
|
|
|
+ :key="code"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ closable
|
|
|
|
|
+ @close="removeWesternDisease(code)"
|
|
|
|
|
+ >{{ westernDiseaseNameMap[code] || code }}</el-tag>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-autocomplete
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- v-model="editData.westernDisease"
|
|
|
|
|
|
|
+ v-model="westernDiseaseSearch"
|
|
|
|
|
+ :fetch-suggestions="queryWesternDisease"
|
|
|
|
|
+ value-key="westname"
|
|
|
placeholder="请搜索选择"
|
|
placeholder="请搜索选择"
|
|
|
clearable
|
|
clearable
|
|
|
- filterable
|
|
|
|
|
- multiple
|
|
|
|
|
- remote
|
|
|
|
|
- :remote-method="searchWesternDisease"
|
|
|
|
|
- :loading="westernDiseaseLoading"
|
|
|
|
|
- loading-text="搜索中..."
|
|
|
|
|
- @change="onWesternDiseaseChange"
|
|
|
|
|
- popper-class="western-disease-select"
|
|
|
|
|
- @visible-change="onWesternDiseaseVisible"
|
|
|
|
|
|
|
+ :trigger-on-focus="true"
|
|
|
|
|
+ @select="onWesternDiseaseSelect"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, idx) in westernDiseaseOptions"
|
|
|
|
|
- :key="idx"
|
|
|
|
|
- :label="item.westname"
|
|
|
|
|
- :value="String(item.westcode)"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
|
+ <div :class="{ 'autocomplete-disabled': item._disabled }">
|
|
|
|
|
+ {{ item.westname }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-autocomplete>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-item flex flex-col-center form-item-half">
|
|
<div class="form-item flex flex-col-center form-item-half">
|
|
@@ -381,49 +384,46 @@
|
|
|
<span style="opacity:0">*</span>
|
|
<span style="opacity:0">*</span>
|
|
|
<div class="name">证型:</div>
|
|
<div class="name">证型:</div>
|
|
|
<div class="input">
|
|
<div class="input">
|
|
|
- <el-select
|
|
|
|
|
|
|
+ <el-autocomplete
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- v-model="editData.symptomid"
|
|
|
|
|
|
|
+ v-model="editData.symptomName"
|
|
|
|
|
+ :fetch-suggestions="querySymptom"
|
|
|
|
|
+ value-key="symname"
|
|
|
placeholder="请搜索选择"
|
|
placeholder="请搜索选择"
|
|
|
clearable
|
|
clearable
|
|
|
- filterable
|
|
|
|
|
- :loading="symptomLoading"
|
|
|
|
|
- loading-text="搜索中..."
|
|
|
|
|
- :filter-method="searchSymptom"
|
|
|
|
|
- @change="onSymptomChange"
|
|
|
|
|
- @focus="searchSymptom('')"
|
|
|
|
|
|
|
+ :trigger-on-focus="true"
|
|
|
|
|
+ @select="onSymptomSelect"
|
|
|
|
|
+ @clear="onSymptomClear"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, idx) in symptomOptions"
|
|
|
|
|
- :key="idx"
|
|
|
|
|
- :label="item.symname"
|
|
|
|
|
- :value="String(item.symid)"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
|
+ <div :class="{ 'autocomplete-disabled': item._disabled }">
|
|
|
|
|
+ {{ item.symname }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-autocomplete>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-item flex flex-col-center">
|
|
<div class="form-item flex flex-col-center">
|
|
|
<span style="opacity:0">*</span>
|
|
<span style="opacity:0">*</span>
|
|
|
<div class="name">治法:</div>
|
|
<div class="name">治法:</div>
|
|
|
<div class="input">
|
|
<div class="input">
|
|
|
- <el-select
|
|
|
|
|
|
|
+ <el-autocomplete
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- v-model="editData.therapyCode"
|
|
|
|
|
|
|
+ v-model="editData.therapyName"
|
|
|
|
|
+ :fetch-suggestions="queryTherapy"
|
|
|
|
|
+ value-key="therapy"
|
|
|
placeholder="请搜索选择"
|
|
placeholder="请搜索选择"
|
|
|
clearable
|
|
clearable
|
|
|
- filterable
|
|
|
|
|
- :loading="therapyLoading"
|
|
|
|
|
- loading-text="搜索中..."
|
|
|
|
|
- :filter-method="searchTherapy"
|
|
|
|
|
- @focus="searchTherapy('')"
|
|
|
|
|
|
|
+ :trigger-on-focus="true"
|
|
|
|
|
+ @select="onTherapySelect"
|
|
|
|
|
+ @clear="onTherapyClear"
|
|
|
>
|
|
>
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, idx) in therapyOptions"
|
|
|
|
|
- :key="idx"
|
|
|
|
|
- :label="item.therapy"
|
|
|
|
|
- :value="String(item.therapyCode)"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
|
+ <div :class="{ 'autocomplete-disabled': item._disabled }">
|
|
|
|
|
+ {{ item.therapy }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-autocomplete>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form-item flex flex-col-center">
|
|
<div class="form-item flex flex-col-center">
|
|
@@ -648,6 +648,7 @@ export default {
|
|
|
therapyOptions: [],
|
|
therapyOptions: [],
|
|
|
westernDiseaseOptions: [],
|
|
westernDiseaseOptions: [],
|
|
|
westernDiseaseNameMap: {},
|
|
westernDiseaseNameMap: {},
|
|
|
|
|
+ westernDiseaseSearch: "",
|
|
|
westernDiseasePage: 1,
|
|
westernDiseasePage: 1,
|
|
|
westernDiseaseHasMore: true,
|
|
westernDiseaseHasMore: true,
|
|
|
projectOptions: [],
|
|
projectOptions: [],
|
|
@@ -669,6 +670,10 @@ export default {
|
|
|
editLoading: false,
|
|
editLoading: false,
|
|
|
editData: {
|
|
editData: {
|
|
|
statistics: {},
|
|
statistics: {},
|
|
|
|
|
+ westernDisease: [],
|
|
|
|
|
+ chineseDiseaseName: "",
|
|
|
|
|
+ symptomName: "",
|
|
|
|
|
+ therapyName: "",
|
|
|
},
|
|
},
|
|
|
// 查看详情弹窗
|
|
// 查看详情弹窗
|
|
|
showViewDialog: false,
|
|
showViewDialog: false,
|
|
@@ -745,7 +750,7 @@ export default {
|
|
|
this.editData.therapyCode = "";
|
|
this.editData.therapyCode = "";
|
|
|
this.editData.therapyName = "";
|
|
this.editData.therapyName = "";
|
|
|
this.therapyOptions = [];
|
|
this.therapyOptions = [];
|
|
|
- this.searchSymptom("");
|
|
|
|
|
|
|
+ this.querySymptom("", () => {});
|
|
|
},
|
|
},
|
|
|
onDiseaseClear() {
|
|
onDiseaseClear() {
|
|
|
this.editData.chineseDisease = "";
|
|
this.editData.chineseDisease = "";
|
|
@@ -758,54 +763,86 @@ export default {
|
|
|
this.editData.therapyName = "";
|
|
this.editData.therapyName = "";
|
|
|
this.therapyOptions = [];
|
|
this.therapyOptions = [];
|
|
|
},
|
|
},
|
|
|
- // 证型变更联动
|
|
|
|
|
- onSymptomChange(symid) {
|
|
|
|
|
- const selected = this.symptomOptions.find((item) => item.symid === symid);
|
|
|
|
|
- if (selected) {
|
|
|
|
|
- this.editData.symptomName = selected.symname;
|
|
|
|
|
- this.editData.symptomCode = selected.synCode || "";
|
|
|
|
|
- }
|
|
|
|
|
- // 联动清空治法并重新加载
|
|
|
|
|
- this.editData.therapyCode = "";
|
|
|
|
|
- this.editData.therapyName = "";
|
|
|
|
|
- this.therapyOptions = [];
|
|
|
|
|
- if (symid) {
|
|
|
|
|
- this.searchTherapy("");
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
// ========== 证型搜索 ==========
|
|
// ========== 证型搜索 ==========
|
|
|
- async searchSymptom(query) {
|
|
|
|
|
- this.symptomLoading = true;
|
|
|
|
|
|
|
+ async querySymptom(queryString, cb) {
|
|
|
|
|
+ this._prevSymptomInput = queryString;
|
|
|
try {
|
|
try {
|
|
|
- const params = { keyword: query || "" };
|
|
|
|
|
|
|
+ const params = { keyword: queryString || "" };
|
|
|
if (this.editData.chineseDisease)
|
|
if (this.editData.chineseDisease)
|
|
|
params.disid = this.editData.chineseDisease;
|
|
params.disid = this.editData.chineseDisease;
|
|
|
if (this.editData.disCode) params.disCode = this.editData.disCode;
|
|
if (this.editData.disCode) params.disCode = this.editData.disCode;
|
|
|
const { list } = await getSymptomListMethod(1, 9999, params);
|
|
const { list } = await getSymptomListMethod(1, 9999, params);
|
|
|
- this.symptomOptions = list || [];
|
|
|
|
|
|
|
+ if (list && list.length > 0) {
|
|
|
|
|
+ cb(list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cb([{ symname: "暂无数据", _disabled: true }]);
|
|
|
|
|
+ }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error("搜索证型失败", e);
|
|
console.error("搜索证型失败", e);
|
|
|
- } finally {
|
|
|
|
|
- this.symptomLoading = false;
|
|
|
|
|
|
|
+ cb([{ symname: "搜索失败,请重试", _disabled: true }]);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onSymptomSelect(item) {
|
|
|
|
|
+ if (item._disabled) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.editData.symptomName = this._prevSymptomInput || "";
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.editData.symptomid = String(item.symid);
|
|
|
|
|
+ this.editData.symptomName = item.symname;
|
|
|
|
|
+ this.editData.symptomCode = item.synCode || "";
|
|
|
|
|
+ // 联动清空治法并重新加载
|
|
|
|
|
+ this.editData.therapyCode = "";
|
|
|
|
|
+ this.editData.therapyName = "";
|
|
|
|
|
+ this.therapyOptions = [];
|
|
|
|
|
+ if (item.symid) {
|
|
|
|
|
+ this.queryTherapy("", () => {});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ onSymptomClear() {
|
|
|
|
|
+ this.editData.symptomid = "";
|
|
|
|
|
+ this.editData.symptomName = "";
|
|
|
|
|
+ this.editData.symptomCode = "";
|
|
|
|
|
+ // 联动清空治法
|
|
|
|
|
+ this.editData.therapyCode = "";
|
|
|
|
|
+ this.editData.therapyName = "";
|
|
|
|
|
+ this.therapyOptions = [];
|
|
|
|
|
+ },
|
|
|
// ========== 治法搜索 ==========
|
|
// ========== 治法搜索 ==========
|
|
|
- async searchTherapy(query) {
|
|
|
|
|
- this.therapyLoading = true;
|
|
|
|
|
|
|
+ async queryTherapy(queryString, cb) {
|
|
|
|
|
+ this._prevTherapyInput = queryString;
|
|
|
try {
|
|
try {
|
|
|
- const params = { keyword: query || "" };
|
|
|
|
|
|
|
+ const params = { keyword: queryString || "" };
|
|
|
if (this.editData.disCode) params.disCode = this.editData.disCode;
|
|
if (this.editData.disCode) params.disCode = this.editData.disCode;
|
|
|
if (this.editData.symptomid) {
|
|
if (this.editData.symptomid) {
|
|
|
params.symptomCode = this.editData.symptomid;
|
|
params.symptomCode = this.editData.symptomid;
|
|
|
params.symid = this.editData.symptomid;
|
|
params.symid = this.editData.symptomid;
|
|
|
}
|
|
}
|
|
|
const { list } = await getTherapyListMethod(1, 9999, params);
|
|
const { list } = await getTherapyListMethod(1, 9999, params);
|
|
|
- this.therapyOptions = list || [];
|
|
|
|
|
|
|
+ if (list && list.length > 0) {
|
|
|
|
|
+ cb(list);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cb([{ therapy: "暂无数据", _disabled: true }]);
|
|
|
|
|
+ }
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
|
console.error("搜索治法失败", e);
|
|
console.error("搜索治法失败", e);
|
|
|
- } finally {
|
|
|
|
|
- this.therapyLoading = false;
|
|
|
|
|
|
|
+ cb([{ therapy: "搜索失败,请重试", _disabled: true }]);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onTherapySelect(item) {
|
|
|
|
|
+ if (item._disabled) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.editData.therapyName = this._prevTherapyInput || "";
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+ this.editData.therapyCode = String(item.therapyCode);
|
|
|
|
|
+ this.editData.therapyName = item.therapy;
|
|
|
|
|
+ },
|
|
|
|
|
+ onTherapyClear() {
|
|
|
|
|
+ this.editData.therapyCode = "";
|
|
|
|
|
+ this.editData.therapyName = "";
|
|
|
},
|
|
},
|
|
|
// ========== 西医诊断搜索(分页) ==========
|
|
// ========== 西医诊断搜索(分页) ==========
|
|
|
async searchWesternDisease(query) {
|
|
async searchWesternDisease(query) {
|
|
@@ -909,8 +946,38 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- onWesternDiseaseChange(codes) {
|
|
|
|
|
- const names = codes
|
|
|
|
|
|
|
+ async queryWesternDisease(queryString, cb) {
|
|
|
|
|
+ await this.searchWesternDisease(queryString);
|
|
|
|
|
+ if (this.westernDiseaseOptions.length > 0) {
|
|
|
|
|
+ cb(this.westernDiseaseOptions);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ cb([{ westname: "暂无数据", _disabled: true }]);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onWesternDiseaseSelect(item) {
|
|
|
|
|
+ if (item._disabled) {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.westernDiseaseSearch = "";
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const code = String(item.westcode);
|
|
|
|
|
+ if (!this.editData.westernDisease.includes(code)) {
|
|
|
|
|
+ this.editData.westernDisease.push(code);
|
|
|
|
|
+ this.westernDiseaseNameMap[code] = item.westname;
|
|
|
|
|
+ this.updateWesternDiseaseName();
|
|
|
|
|
+ }
|
|
|
|
|
+ this.westernDiseaseSearch = "";
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.searchWesternDisease("");
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ removeWesternDisease(code) {
|
|
|
|
|
+ this.editData.westernDisease = this.editData.westernDisease.filter((c) => c !== code);
|
|
|
|
|
+ this.updateWesternDiseaseName();
|
|
|
|
|
+ },
|
|
|
|
|
+ updateWesternDiseaseName() {
|
|
|
|
|
+ const names = this.editData.westernDisease
|
|
|
.map((code) => this.westernDiseaseNameMap[code] || "")
|
|
.map((code) => this.westernDiseaseNameMap[code] || "")
|
|
|
.filter(Boolean);
|
|
.filter(Boolean);
|
|
|
this.editData.westernDiseaseName = names.join(",");
|
|
this.editData.westernDiseaseName = names.join(",");
|
|
@@ -1521,6 +1588,15 @@ export default {
|
|
|
.autocomplete-disabled {
|
|
.autocomplete-disabled {
|
|
|
color: #999 !important;
|
|
color: #999 !important;
|
|
|
cursor: not-allowed !important;
|
|
cursor: not-allowed !important;
|
|
|
|
|
+ pointer-events: none;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.western-disease-tags {
|
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
|
+ .el-tag {
|
|
|
|
|
+ margin-right: 4px;
|
|
|
|
|
+ margin-bottom: 2px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.dialog-scroll-area ::v-deep .recipe-acupoint {
|
|
.dialog-scroll-area ::v-deep .recipe-acupoint {
|