From 49fcdb7178dffc69769e2fb8cb6a03e204cb1e68 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期五, 31 五月 2024 18:26:42 +0800 Subject: [PATCH] 测试完成 --- src/views/patient/patient/profile/index.vue | 88 +++++++++++++++++++++++++++++++++---------- 1 files changed, 67 insertions(+), 21 deletions(-) diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue index 2be9058..2f08635 100644 --- a/src/views/patient/patient/profile/index.vue +++ b/src/views/patient/patient/profile/index.vue @@ -145,27 +145,30 @@ <el-col :span="24" ><div class="xinz-inf"> <el-tag - :key="tag" + :key="tag.tagid" type="success" v-for="tag in dynamicTags" closable :disable-transitions="false" @close="handleClose(tag)" > - {{ tag }} + {{ tag.tagname }} </el-tag> <el-select v-model="inputValue" v-if="inputVisible" @change="handleInputConfirm" + :remote-method="remoteMethod" + remote filterable allow-create default-first-option - placeholder="璇烽�夋嫨" + placeholder="璇烽�夋嫨/鏌ヨ" + :loading="loading" > <el-option v-for="item in options" - :key="item.tagname" + :key="item.tagid" :label="item.tagname" :value="item.tagname" > @@ -650,6 +653,7 @@ titletb: "鏂板鑱旂郴鏂瑰紡", activeTab: "userinfo", id: "", + loading: false, activeName: "health", //涓�绫诲鑸� sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅 sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅 @@ -789,6 +793,9 @@ this.tableData = response.rows; }); }, + processElement(element) { + return { ...element, isoperation: null }; + }, // 鑾峰彇鍩虹淇℃伅 getuserinfo() { const queryParams = { @@ -799,7 +806,8 @@ // 鎮h�呭熀纭�淇℃伅 messagelistpatient(queryParams).then((response) => { this.userform = response.rows[0]; - this.dynamicTags = response.rows[0].tagList; + // this.dynamicTags = response.rows[0].tagList; + this.dynamicTags = response.rows[0].tagList.map(this.processElement); }); // 鐥呭彶淇℃伅 getmedicalhistory({ pid: this.id }).then((res) => { @@ -810,7 +818,8 @@ }, // 淇濆瓨鎮h�呮。妗� savefile() { - this.userform.tagList = this.dynamicTags; + // this.userform.tagList = this.dynamicTags; + this.userform.isoperation = 2; alterpatient(this.userform).then((res) => { if (res.code == 200) { this.$modal.msgSuccess("鍩虹淇℃伅淇濆瓨鎴愬姛"); @@ -818,7 +827,7 @@ this.$modal.msgError("鍩虹淇℃伅淇敼澶辫触"); } }); - // 鐥呭彶 + // 鐥呭彶鏄� this.medicalhistory(); }, // 鐥呭彶 @@ -920,12 +929,18 @@ .catch(() => {}); }, tableRowClassName({ row, rowIndex }) { - console.log(row); if (row.isdefault == "1") { return "warning-row"; } return ""; }, + // tab鍒囨崲 + handleClick(tab, event) { + console.log(tab, event); + }, + // 鑱旂郴鏂瑰紡鏂板 + Addanumber() {}, + // 鏍囩-------------------------- /** 鏌ヨ鏍囩鍒楄〃 */ gettabList() { const tagqueryParams = { @@ -937,28 +952,59 @@ this.options = response.rows; }); }, - - // tab鍒囨崲 - handleClick(tab, event) { - console.log(tab, event); + remoteMethod(value) { + const illnessqueryParams = { + pageNum: 1, + pageSize: 100, + tagname: value, + tagcategoryid: "0", + }; + this.loading = true; + setTimeout(() => { + this.loading = false; + listtag(illnessqueryParams).then((response) => { + this.options = response.rows; + }); + }, 200); }, - // 鑱旂郴鏂瑰紡鏂板 - Addanumber() {}, handleClose(tag) { + const lindex = this.dynamicTags.indexOf(tag); this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); + this.userform.tagList[lindex].isoperation = 3; }, showInput() { this.inputVisible = true; - this.$nextTick((_) => { - this.$refs.saveTagInput.$refs.input.focus(); - }); + // this.$nextTick((_) => { + // this.$refs.saveTagInput.$refs.input.focus(); + // }); }, handleInputConfirm() { - let inputValue = this.inputValue; - if (inputValue) { - this.dynamicTags.push(inputValue); + let tagvalue = {}; + let tagname = this.inputValue; + if (tagname) { + listtag({ + pageNum: 1, + pageSize: 1000, + tagcategoryid: "0", + tagname: tagname, + }).then((res) => { + if (res.rows[0]) { + tagvalue = res.rows[0]; + tagvalue.isoperation = 1; + } else { + tagvalue = { + tagname: tagname, + isoperation: 1, + }; + } + console.log(tagvalue); + this.userform.tagList.push(tagvalue); + this.dynamicTags.push(tagvalue); + console.log(this.userform.tagList); + console.log(this.dynamicTags); + }); } this.inputVisible = false; this.inputValue = ""; @@ -1452,7 +1498,7 @@ } .xinz-inf { font-size: 18px; - white-space: nowrap; + // white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -- Gitblit v1.9.3