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 | 416 ++++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 294 insertions(+), 122 deletions(-) diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue index cba7f89..2f08635 100644 --- a/src/views/patient/patient/profile/index.vue +++ b/src/views/patient/patient/profile/index.vue @@ -6,14 +6,27 @@ <el-col :span="18"> <div class="headportrait"> <div class="text-center"> - <img v-imgError="require('@/assets/common/head.jpg')" src="" /> + <img + v-imgError="require('@/assets/images/shoushuzhudaoyisheng.png')" + src="" + /> </div> - <div style="margin-left: 10px">鍚村ぇ榫�</div> - <div style="margin-left: 10px" class="text-title">鐢�</div> - <div style="margin-left: 10px" class="text-title">66宀�</div> - <div style="margin-left: 10px" class="text-title">1999.12.18</div> - <div style="margin-left: 10px" class="text-title">姹夋棌</div> - <div style="margin-left: 10px" class="text-title">娌冲崡淇¢槼</div> + <div style="margin-left: 10px">{{ userform.name }}</div> + <div style="margin-left: 10px" class="text-title"> + {{ userform.sex == 1 ? "鐢�" : "濂�" }} + </div> + <div style="margin-left: 10px" class="text-title"> + {{ userform.age }}宀� + </div> + <div style="margin-left: 10px" class="text-title"> + {{ userform.birthdate }} + </div> + <div style="margin-left: 10px" class="text-title"> + {{ userform.nation }} + </div> + <div style="margin-left: 10px" class="text-title"> + {{ userform.birthplace }} + </div> </div></el-col > </el-row> @@ -103,30 +116,28 @@ <el-row :gutter="20"> <el-col :span="12" ><div class="grid-content bg-purple"> - 鎮h�呭鍚嶏細<span class="spanvalue">鐜嬪ぇ缇�</span> + 鎮h�呭鍚嶏細<span class="spanvalue">{{ userform.name }}</span> </div></el-col > <el-col :span="12" ><div class="grid-content bg-purple"> - 鑱旂郴鐢佃瘽锛�<span class="spanvalue">13803963330</span> + 鑱旂郴鐢佃瘽锛�<span class="spanvalue">{{ userform.telcode }}</span> </div></el-col > </el-row> <el-row :gutter="20"> <el-col :span="24" ><div class="grid-content bg-purple"> - 鍑虹敓鍦帮細<span class="spanvalue" - >娴欐睙鐪佹澀宸炲競浣欐澀鍖轰綑鏉閬�</span - > + 鍑虹敓鍦帮細<span class="spanvalue">{{ userform.birthplace }}</span> </div></el-col > </el-row> <el-row :gutter="20"> <el-col :span="24" ><div class="grid-content bg-purple"> - 灞呬綇鍦帮細<span class="spanvalue" - >娴欐睙鐪佹澀宸炲競浣欐澀鍖轰綑鏉閬�</span - > + 灞呬綇鍦帮細<span class="spanvalue">{{ + userform.placeOfResidence + }}</span> </div></el-col > </el-row> @@ -134,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" > @@ -176,12 +190,12 @@ <div class="top-message"> <div class="headline">鐥呭彶</div> <div class="detailed"> - <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-form ref="form" :model="form" label-width="100px"> <el-row> <el-col :span="8"> <el-form-item label="杩囧線鐤剧梾" prop="name"> <el-input - v-model="form.name" + v-model="form.pastIllnesses" placeholder="璇疯緭鍏�" maxlength="30" /> @@ -190,7 +204,7 @@ <el-col :span="8"> <el-form-item label="鑽墿杩囨晱" prop="sex"> <el-input - v-model="form.name" + v-model="form.drugAllergy" placeholder="璇疯緭鍏ュ叿浣撹嵂鐗�/鏃�" maxlength="30" /> @@ -199,7 +213,7 @@ <el-col :span="8"> <el-form-item label="瀹舵棌鐥呭彶" prop="age"> <el-input - v-model="form.age" + v-model="form.familyHistory" placeholder="璇疯緭鍏ュ叿浣撶柧鐥�/鏃�" maxlength="30" /> @@ -210,7 +224,7 @@ <el-col :span="8"> <el-form-item label="鎵嬫湳鍙�" prop="name"> <el-input - v-model="form.name" + v-model="form.surgicalHistory" placeholder="璇疯緭鍏ユ墜鏈�/鏃�" maxlength="30" /> @@ -219,62 +233,62 @@ <el-col :span="8"> <el-form-item label="鐢熻偛鍙�" prop="age"> <el-input - v-model="form.age" + v-model="form.reproductiveHistory" placeholder="璇疯緭鍏ヨ儙鏁�/鏃�" maxlength="30" /> </el-form-item> </el-col> <el-col :span="8"> - <el-form-item label="鏈堢粡鍙�" prop="telcode"> - <el-radio-group v-model="form.radio"> - <el-radio :label="1">鏈�</el-radio> - <el-radio :label="2">鏃�</el-radio> + <el-form-item label="鏈堢粡鍙�" prop="menstrualHistory"> + <el-radio-group v-model="form.menstrualHistory"> + <el-radio label="1">鏈�</el-radio> + <el-radio label="2">鏃�</el-radio> </el-radio-group> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="8"> - <el-form-item label="鍚哥儫鎯呭喌" prop="idcardtype"> - <el-radio-group v-model="form.radio"> - <el-radio :label="1">鏈�</el-radio> - <el-radio :label="2">鏃�</el-radio> + <el-form-item label="鍚哥儫鎯呭喌" prop="smoking"> + <el-radio-group v-model="form.smoking"> + <el-radio label="1">鏈�</el-radio> + <el-radio label="2">鏃�</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="8"> - <el-form-item label="楗厭鎯呭喌" prop="idcardno"> - <el-radio-group v-model="form.radios"> - <el-radio :label="1">鏈�</el-radio> - <el-radio :label="2">鏃�</el-radio> + <el-form-item label="楗厭鎯呭喌" prop="drink"> + <el-radio-group v-model="form.drink"> + <el-radio label="1">鏈�</el-radio> + <el-radio label="2">鏃�</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="8"> - <el-form-item label="杩愬姩鎯呭喌" prop="idcardno"> - <el-radio-group v-model="form.radiosa"> - <el-radio :label="1">鏈�</el-radio> - <el-radio :label="2">鏃�</el-radio> + <el-form-item label="杩愬姩鎯呭喌" prop="motion"> + <el-radio-group v-model="form.motion"> + <el-radio label="1">鏈�</el-radio> + <el-radio label="2">鏃�</el-radio> </el-radio-group> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> - <el-form-item label="楗鎯呭喌" prop="idcardno"> - <el-radio-group v-model="form.radiosa"> - <el-radio :label="1">杩囧害楗</el-radio> - <el-radio :label="2">姝e父楗</el-radio> - <el-radio :label="3">椋熸涓嶆尟</el-radio> + <el-form-item label="楗鎯呭喌" prop="diet"> + <el-radio-group v-model="form.diet"> + <el-radio label="1">杩囧害楗</el-radio> + <el-radio label="2">姝e父楗</el-radio> + <el-radio label="3">椋熸涓嶆尟</el-radio> </el-radio-group> </el-form-item> </el-col ><el-col :span="12"> - <el-form-item label="蹇冪悊鎯呭喌" prop="idcardno"> - <el-radio-group v-model="form.radiosa"> - <el-radio :label="1">蹇冩儏鎰夋偊</el-radio> - <el-radio :label="2">杞诲井鐒﹁檻</el-radio> - <el-radio :label="3">鎶戦儊</el-radio> + <el-form-item label="蹇冪悊鎯呭喌" prop="psychology"> + <el-radio-group v-model="form.psychology"> + <el-radio label="1">蹇冩儏鎰夋偊</el-radio> + <el-radio label="2">杞诲井鐒﹁檻</el-radio> + <el-radio label="3">鎶戦儊</el-radio> </el-radio-group> </el-form-item> </el-col> @@ -286,19 +300,21 @@ <div class="bottom-message"> <div class="headline"> 鍙风爜缁存姢<span style="margin-right: 60px"> </span> - <el-button type="primary" @click="AddanumberVisible = true" - >+鏂板</el-button - > + <el-button type="primary" @click="addcompiletb">+鏂板</el-button> </div> <div class="Table-screen"> - <el-table :data="tableData" style="width: 100%"> + <el-table + :data="tableData" + style="width: 100%" + :row-class-name="tableRowClassName" + > <el-table-column prop="id" label="搴忓彿" width="180"> </el-table-column> - <el-table-column prop="name" label="濮撳悕" width="180"> + <el-table-column prop="contactname" label="濮撳悕" width="180"> </el-table-column> - <el-table-column prop="phonenumber" label="鑱旂郴鏂瑰紡" width="180"> + <el-table-column prop="contactway" label="鑱旂郴鏂瑰紡" width="180"> </el-table-column> - <el-table-column prop="concern" label="鍏崇郴"> </el-table-column> + <el-table-column prop="relation" label="鍏崇郴"> </el-table-column> <el-table-column label-class-name="columcz" fixed="right" @@ -306,11 +322,22 @@ width="300" > <template slot-scope="scope"> - <el-button type="success" size="small" + <el-button + type="success" + size="small" + @click="defaulttb(scope.row)" >璁句负榛樿鑱旂郴鏂瑰紡</el-button > - <el-button type="warning" size="small">缂栬緫</el-button> - <el-button type="danger" size="small">鍒犻櫎</el-button> + <el-button + @click="compiletb(scope.row)" + type="warning" + size="small" + >缂栬緫</el-button + > + + <el-button @click="deltb(scope.row)" type="danger" size="small" + >鍒犻櫎</el-button + > </template> </el-table-column> </el-table> @@ -567,21 +594,21 @@ </div> </div> - <el-dialog title="鏂板鑱旂郴鏂瑰紡" :visible.sync="AddanumberVisible"> + <el-dialog :title="titletb" :visible.sync="AddanumberVisible"> <el-form :model="numberform" label-width="100px"> <el-form-item label="濮撳悕"> - <el-input v-model="numberform.name"></el-input> + <el-input v-model="numberform.contactname"></el-input> </el-form-item> <el-form-item label="鑱旂郴鐢佃瘽"> - <el-input v-model="numberform.name"></el-input> + <el-input v-model="numberform.contactway"></el-input> </el-form-item> <el-form-item label="鍏崇郴"> - <el-input v-model="numberform.name"></el-input> + <el-input v-model="numberform.relation"></el-input> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button @click="AddanumberVisible = false">鍙� 娑�</el-button> - <el-button type="primary" @click="Addanumber">纭� 瀹�</el-button> + <el-button type="primary" @click="archivecontact">纭� 瀹�</el-button> </div> </el-dialog> </div> @@ -599,9 +626,12 @@ addmedicalhistory, getmedicalhistory, editmedicalhistory, - deletepatient, - Exporterrorpatient, - toleadpatient, + addcontactinformation, + editcontactinformation, + getcontactinformation, + delcontactinformation, + listcontactinformation, + alterpatient, } from "@/api/patient/homepage"; export default { @@ -620,12 +650,14 @@ tjnumber: 12, yynumber: 12, total: 0, // 鎬绘潯鏁� + titletb: "鏂板鑱旂郴鏂瑰紡", activeTab: "userinfo", id: "", + loading: false, activeName: "health", //涓�绫诲鑸� sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅 sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅 - dynamicTags: ["鏍囩涓�", "鏍囩浜�", "鏍囩涓�"], + dynamicTags: [], record: [ { name: "瀹f暀浠诲姟", @@ -652,28 +684,7 @@ echartdom: {}, xtechartdom: {}, tzechartdom: {}, - tableData: [ - { - date: "2016-05-02", - name: "鐜嬪皬铏�", - address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�", - }, - { - date: "2016-05-04", - name: "鐜嬪皬铏�", - address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�", - }, - { - date: "2016-05-01", - name: "鐜嬪皬铏�", - address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�", - }, - { - date: "2016-05-03", - name: "鐜嬪皬铏�", - address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�", - }, - ], + tableData: [], tableDatalist: [ { id: 12, @@ -771,28 +782,165 @@ this.getuserinfo(); this.gettabList(); }, - methods() {}, methods: { // 鏌ヨ妗f鍒楄〃淇℃伅 getList() { this.loading = true; }, + getcontactlist() { + listcontactinformation({ patid: this.id }).then((response) => { + this.tableData = response.rows; + }); + }, + processElement(element) { + return { ...element, isoperation: null }; + }, + // 鑾峰彇鍩虹淇℃伅 getuserinfo() { - console.log(this.id); const queryParams = { pid: Number(this.id), allhosp: "0", pageNum: 1, }; + // 鎮h�呭熀纭�淇℃伅 messagelistpatient(queryParams).then((response) => { - console.log(response); this.userform = response.rows[0]; - console.log(this.userform); + // this.dynamicTags = response.rows[0].tagList; + this.dynamicTags = response.rows[0].tagList.map(this.processElement); }); + // 鐥呭彶淇℃伅 + getmedicalhistory({ pid: this.id }).then((res) => { + this.form = res.rows[0]; + }); + // 鑱旂郴淇℃伅 + this.getcontactlist(); }, // 淇濆瓨鎮h�呮。妗� - savefile() {}, + savefile() { + // this.userform.tagList = this.dynamicTags; + this.userform.isoperation = 2; + alterpatient(this.userform).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鍩虹淇℃伅淇濆瓨鎴愬姛"); + } else { + this.$modal.msgError("鍩虹淇℃伅淇敼澶辫触"); + } + }); + // 鐥呭彶鏄� + this.medicalhistory(); + }, + // 鐥呭彶 + medicalhistory() { + if (this.form.id) { + editmedicalhistory(this.form).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鐥呭彶淇濆瓨鎴愬姛"); + } else { + this.$modal.msgError("鐥呭彶淇敼澶辫触"); + } + }); + } else { + this.form.pid = this.id; + addmedicalhistory(this.form).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鐥呭彶淇濆瓨鎴愬姛"); + } else { + this.$modal.msgError("鐥呭彶淇敼澶辫触"); + } + }); + } + }, + // 鑱旂郴鏂瑰紡--------------- + archivecontact() { + if (this.numberform.id) { + editcontactinformation(this.numberform).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鑱旂郴鏂瑰紡淇敼鎴愬姛"); + this.getcontactlist(); + this.AddanumberVisible = false; + } else { + this.$modal.msgError("鑱旂郴鏂瑰紡淇敼澶辫触"); + } + }); + } else { + this.numberform.patid = this.id; + addcontactinformation(this.numberform).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鑱旂郴鏂瑰紡鏂板鎴愬姛"); + this.getcontactlist(); + this.AddanumberVisible = false; + } else { + this.$modal.msgError("鑱旂郴鏂瑰紡鏂板澶辫触"); + } + }); + } + this.numberform = {}; + }, + deltb(row) { + this.$modal + .confirm("鏄惁纭鍒犻櫎璇ユ暟鎹」锛�") + .then(() => { + if (row.id) { + delcontactinformation(row.id).then((res) => { + if (res.code == 200) { + this.$modal.msgSuccess("鑱旂郴鏂瑰紡鍒犻櫎鎴愬姛"); + this.getcontactlist(); + } else { + this.$modal.msgError("鑱旂郴鏂瑰紡鍒犻櫎澶辫触"); + } + }); + } else { + let index = this.tableData.indexOf(obj); + this.tableData.splice(index, 1); + } + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => {}); + }, + addcompiletb() { + this.titletb = "鏂板鑱旂郴鏂瑰紡"; + this.AddanumberVisible = true; + }, + compiletb(row) { + this.numberform = row; + this.titletb = "淇敼鑱旂郴鏂瑰紡"; + this.AddanumberVisible = true; + }, + defaulttb(row) { + this.$modal + .confirm("鏄惁纭璁剧疆璇ユ暟鎹」涓洪粯璁よ仈绯讳汉锛�") + .then(() => { + this.tableData.forEach((obj, index) => { + if (obj === row) { + obj.isdefault = 1; + this.numberform = obj; + this.archivecontact(); + } else if (obj.isdefault == 1) { + obj.isdefault = 0; + this.numberform = obj; + this.archivecontact(); + } else { + obj.isdefault = 0; + } + }); + this.$modal.msgSuccess("璁剧疆鎴愬姛"); + }) + .catch(() => {}); + }, + tableRowClassName({ row, rowIndex }) { + if (row.isdefault == "1") { + return "warning-row"; + } + return ""; + }, + // tab鍒囨崲 + handleClick(tab, event) { + console.log(tab, event); + }, + // 鑱旂郴鏂瑰紡鏂板 + Addanumber() {}, + // 鏍囩-------------------------- /** 鏌ヨ鏍囩鍒楄〃 */ gettabList() { const tagqueryParams = { @@ -801,30 +949,62 @@ tagcategoryid: "0", }; listtag(tagqueryParams).then((response) => { - console.log(response); this.options = response.rows; }); }, - 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 = ""; @@ -906,10 +1086,8 @@ // 琛�绯栧浘琛� xtechartsInit() { // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 - // console.log(echarts); - console.log(this.xtechartdom); + var myxyChart = echarts.init(this.xtechartdom); - console.log(myxyChart); const data = [ ["2000-06-05", 116], ["2000-06-06", 129], @@ -1000,15 +1178,13 @@ }, ], }; - console.log("ss"); // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� myxyChart.setOption(option); }, // 浣撻噸鍥捐〃 tzechartsInit() { // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 - console.log(echarts); - console.log(this.tzechartdom); + var myxyChart = echarts.init(this.tzechartdom); var option = { title: { @@ -1067,7 +1243,6 @@ // 蹇冪巼 xlechartsInit() { var myxyChart = echarts.init(this.xlechartdom); - console.log(myxyChart); const data = [ ["2000-06-05", 116], ["2000-06-06", 129], @@ -1140,7 +1315,6 @@ }, ], }; - console.log("ss"); // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� myxyChart.setOption(option); }, @@ -1219,7 +1393,6 @@ }, ], }; - console.log("ss"); // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� myxyChart.setOption(option); }, @@ -1285,7 +1458,6 @@ }, ], }; - console.log("ss"); // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� myxyChart.setOption(option); }, @@ -1326,7 +1498,7 @@ } .xinz-inf { font-size: 18px; - white-space: nowrap; + // white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -1421,7 +1593,7 @@ .sontwoactiveName { margin: 0 auto; } -// .columcz { -// align-items: center!important; -// } +::v-deep.el-table .warning-row { + background: oldlace; +} </style> -- Gitblit v1.9.3