From d03c0c366862d917bdac6ba9cab8d338e722da10 Mon Sep 17 00:00:00 2001 From: yz3456 <2753272399@qq.com> Date: 星期二, 11 六月 2024 14:12:38 +0800 Subject: [PATCH] 修改 --- ruoyi-ui/src/views/healthy/healthYear.vue | 113 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 93 insertions(+), 20 deletions(-) diff --git a/ruoyi-ui/src/views/healthy/healthYear.vue b/ruoyi-ui/src/views/healthy/healthYear.vue index 1ff3ff4..6e3ff87 100644 --- a/ruoyi-ui/src/views/healthy/healthYear.vue +++ b/ruoyi-ui/src/views/healthy/healthYear.vue @@ -597,12 +597,12 @@ v-loading="loading" :data="HealthNoteList" > <el-button size='mini' type="text" class="btn_edit" @click="saveData" style='top: 0px;right: 20px;'> <sapn v-html="'\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'"></sapn> - <span >{{ editMode ? '淇濆瓨' : '淇敼' }}</span> + <span >{{ editMode ? this.bstn='淇濆瓨' : this.bstn='淇敼' }}</span> </el-button> <el-tab-pane label="鐢熸椿涔犳儻" name="lifeHabits" > <template v-if="editMode"> <div style="padding-top: 10px"> - <el-input v-model="HealthNoteList.lifeHabits" ></el-input> + <el-input v-model="HealthNoteList.lifeHabits" type="textarea" ></el-input> </div> </template> <template v-else> @@ -610,35 +610,91 @@ </template> </el-tab-pane> <el-tab-pane label="浠ュ線鐥呭彶" name="historyDisease"> - {{HealthNoteList.historyDisease}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.historyDisease" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.historyDisease}} + </template> </el-tab-pane> <el-tab-pane label="娌荤枟淇℃伅" name="treatmentInfo"> <!-- 娌荤枟淇℃伅鐨勫唴瀹� --> - {{HealthNoteList.treatmentInfo}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.treatmentInfo" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.treatmentInfo}} + </template> </el-tab-pane> <el-tab-pane label="瀹舵棌鐥呭彶" name="familyDisease"> <!-- 瀹舵棌鐥呭彶鐨勫唴瀹� --> - {{HealthNoteList.familyDisease}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.familyDisease" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.familyDisease}} + </template> </el-tab-pane> <el-tab-pane label="鐜扮梾鍙�" name="nowDisease"> <!-- 鐩墠鐥呮儏鐨勫唴瀹� --> - {{HealthNoteList.nowDisease}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.nowDisease" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.nowDisease}} + </template> </el-tab-pane> <el-tab-pane label="鐤剧梾鍙戠敓" name="diseaseHappen"> <!-- 鐤剧梾鍙戠敓鐨勫唴瀹� --> - {{HealthNoteList.diseaseHappen}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.diseaseHappen" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.diseaseHappen}} + </template> </el-tab-pane> <el-tab-pane label="鐤剧梾鍙戝睍" name="diseaseDevelop"> <!-- 鐤剧梾鍙戝睍鐨勫唴瀹� --> - {{HealthNoteList.diseaseDevelop}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.diseaseDevelop" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.diseaseDevelop}} + </template> </el-tab-pane> <el-tab-pane label="鐤剧梾娌荤枟" name="diseaseTreat"> <!-- 鐤剧梾娌荤枟鐨勫唴瀹� --> - {{HealthNoteList.diseaseTreat}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.diseaseTreat" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.diseaseTreat}} + </template> </el-tab-pane> <el-tab-pane label="鐤剧梾澶嶅彂" name="diseaseBack"> <!-- 鐤剧梾澶嶅彂鐨勫唴瀹� --> - {{HealthNoteList.diseaseBack}}} + <template v-if="editMode"> + <div style="padding-top: 10px"> + <el-input v-model="HealthNoteList.diseaseBack" type="textarea" ></el-input> + </div> + </template> + <template v-else> + {{HealthNoteList.diseaseBack}} + </template> </el-tab-pane> </el-tabs> </div> @@ -701,6 +757,7 @@ ids: [], // 闈炲崟涓鐢� single: true, + bstn: '淇敼', // 闈炲涓鐢� multiple: true, // 鏄剧ず鎼滅储鏉′欢 @@ -941,7 +998,7 @@ // 鏁版嵁鑼冨洿閫夐」 fot:['.bmp','.jpg','.jpeg','.png','.tif','.gif','.pcx','.tga','.exif','.fpx', '.svg','.psd','.cdr','.pcd','.dxf','.ufo','.eps','.ai','.aw','.WMF','.webp','.apng'], - + fileList:[ ], fileListOther:[ @@ -982,18 +1039,34 @@ }, created() { this.getList() - + this.$route.meta.title = "鐜扮姸鍋ュ悍鎯呭喌"; + this.$route.meta.title = "鐜扮姸鍋ュ悍鎯呭喌"; }, methods: { saveData() { // 灏嗘暟鎹彂閫佺粰鍚庣 - const data = { - lifeHabits: this.HealthNoteList.lifeHabits, - historyDisease: this.HealthNoteList.historyDisease, - // 鍏朵粬瀛楁鐪佺暐锛岃琛ュ厖瀹屾暣 - }; - + // alert(this.bstn) + this.editMode= true + if(this.bstn=="淇濆瓨") + { + const data = { + lifeHabits: this.HealthNoteList.lifeHabits, + historyDisease: this.HealthNoteList.historyDisease, + treatmentInfo: this.HealthNoteList.treatmentInfo, + familyDisease:this.HealthNoteList.familyDisease, + nowDisease: this.HealthNoteList.nowDisease,// 鐜扮梾鍙� + diseaseHappen: this.HealthNoteList.diseaseHappen,// 鐤剧梾鐨勫彂鐢� + diseaseDevelop: this.HealthNoteList.diseaseDevelop,// 鐤剧梾鐨勫彂灞� + diseaseTreat: this.HealthNoteList.diseaseTreat,// 鐤剧梾鐨勬不鐤� + diseaseBack: this.HealthNoteList.diseaseBack// 鐤剧梾鐨勮浆褰� + // 鍏朵粬瀛楁鐪佺暐锛岃琛ュ厖瀹屾暣 + }; + updateHealthNote(data).then(response=>{ + this.$modal.msgSuccess("淇敼鎴愬姛锛�"); + }) + this.editMode = false + } }, //琛�鍨嬩慨鏀� @@ -2008,7 +2081,7 @@ }; console.log(111) console.log(this.bloodData) - + if(isObjectEmpty(this.bloodData)){ this.HealthyBaseList.bloodClass = this.HealthyBaseList.bloodClass; }else { @@ -2202,7 +2275,7 @@ } }) // 鍒锋柊椤甸潰 - + }, //骞村害鍋ュ悍鎶ュ憡 toYearhealthy(){ -- Gitblit v1.9.1