From 6f6e804a48c822f339e1974cfe482bc2f60227a3 Mon Sep 17 00:00:00 2001 From: linwenling <3256558519@qq.com> Date: 星期一, 25 九月 2023 12:42:08 +0800 Subject: [PATCH] 修改健康保健 --- ruoyi-ui/src/views/pet/petInfo.vue | 149 +++++++++++++++++++++++++++++++++---------------- 1 files changed, 99 insertions(+), 50 deletions(-) diff --git a/ruoyi-ui/src/views/pet/petInfo.vue b/ruoyi-ui/src/views/pet/petInfo.vue index 2646546..8d1b52c 100644 --- a/ruoyi-ui/src/views/pet/petInfo.vue +++ b/ruoyi-ui/src/views/pet/petInfo.vue @@ -1,8 +1,23 @@ <template> - <div class="app-container"> + <div class="app-container" id="printable-content"> <div class="form-header mt"> - <h4 class="dt h4">鍩烘湰淇℃伅 </h4> - <el-button type="primary" @click="Petnote(pid)" :disabled="btn">榄呭疇澶囧繕褰�</el-button> + <!-- <h4 class="dt h4">鍩烘湰淇℃伅 </h4> + <el-button type="primary" @click="Petnote(pid)" :disabled="btn">榄呭疇澶囧繕褰�</el-button> --> + <h1 style="font-size:21px;padding-top:30px;display: flex;justify-content: space-between;align-items: center;"> + <span>鍩烘湰淇℃伅</span> + <div style="display: flex; align-items: center;"> + <el-button size="mini" type="text" @click="Petnote(pid)" v-hasPermi="['person:information:memo']"> + <div class="form" ><el-icon style="padding-right:110px;"></el-icon> + <span class="text" style="width: 69px;height: 26px;font-size: 16px; + font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">榄呭疇澶囧繕褰�</span></div> + </el-button> + <el-button size="mini" type="text" v-print="'#printable-content'" v-hasPermi="['person:information:memo']"> + <div class="form" ><el-icon style="padding-right:110px;"></el-icon> + <span class="text" style="width: 69px;height: 26px;font-size: 16px; + font-family: Microsoft YaHei-Regular, Microsoft YaHei; color: #EBA4AA;">鎵撳嵃</span></div> + </el-button> + </div> + </h1> </div> <h2 style="width: 100px;height: 16px;font-size: 15px;font-family: Microsoft YaHei-Regular, Microsoft YaHei;font-weight: 400;color: #000000;line-height: 15px;">鍩烘湰淇℃伅</h2> <el-container > @@ -124,7 +139,7 @@ </el-avatar> </el-col> </div> - + <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼榄呭疇淇℃伅</el-button> </el-col> </div> </el-container> @@ -194,12 +209,20 @@ :src="'http://47.93.189.255:8080/'+ petList.fullPicture" :fit="fit" style="width: 100%;height: 100%;border-radius: 0px 0px 0px 0px;opacity: 1;border: 1px solid rgba(0,0,0,0.5);" ></el-image> + <el-upload class="upload-demo" action="/uploadImage" :on-success="handleUploadSuccess"> + <el-button slot="trigger">鐐瑰嚮涓婁紶鏂板浘鐗�</el-button> + </el-upload> + </el-avatar> </el-col> </div> - <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼榄呭疇淇℃伅</el-button> + <el-button>淇敼</el-button> </el-col> </div> + + + + <el-dialog :visible.sync="dialogVisible"> <img w-full :src="dialogImageUrl" alt="Preview Image" /> @@ -317,7 +340,7 @@ </div> </template> <script> -import {getPetList, getPetowner, listPetnote,getPetnoteList,uploadPic, download,updatePetowner,updatePet,addPetnote} from "@/api/pet/index"; +import {getPetList, listPetnote,uploadPic, download,updatePet} from "@/api/pet/index"; import {addRole, updateRole} from "@/api/system/role"; import {blobValidate} from "@/utils/ruoyi"; import errorCode from "@/utils/errorCode"; @@ -352,8 +375,6 @@ happenEndTime:undefined }, pid:undefined, - dsb:true, - btn:false, title: '榄呭疇澶囧繕褰�', openDataScope: false, PetNoteList:{ @@ -374,17 +395,7 @@ remark: undefined, url: undefined, }, - petownerList: { - email: undefined, - name: undefined, - certificateType: undefined, - certificateNo: undefined, - fixedNo:undefined, - many:undefined, - phoneNo:undefined, - address: undefined, - property: undefined, - }, + dialogImageUrl: '', dialogVisible: false, disabled: false, @@ -424,7 +435,7 @@ computed: {}, watch: {}, created() { - const id = this.$route.params && this.$route.params.pid; + const id = this.$route.params && this.$route.params.id; this.pid = id; let jd; if(this.$route.query.detail!=undefined) @@ -438,6 +449,7 @@ else{ document.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅"; this.$route.meta.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + this.btn = false; } let _this = this @@ -446,12 +458,13 @@ this.loading = true; getPetList(id).then((response) => { this.petList = response.data; + console.log(this.petList) this.loading = false; }); - getPetowner(id).then((response) => { - this.petownerList = response.data; - this.loading = false; - }); + // getPetowner(id).then((response) => { + // this.petownerList = response.data; + // this.loading = false; + // }); } @@ -470,39 +483,68 @@ listPetnote(this.queryParams).then(response => { // alert(123) // console.log(response.data) - console.log(response.data) this.PetNoteList = response.data.data; - this.total = response.data.total; this.loading = false; } ); }, - submitForm() { - let ul = this.fileList.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - let uls = this.fileListOther.map(function (elem){ - return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.petList.url = ul+","+uls + requestUpload(params) + { + var file = params.file; + var formData = new FormData(); - this.$refs['elForm'].validate(valid => { + formData.append('uploadFile', file); + let _this = this - - if (valid) { - if (this.petList.id != undefined) { - updatePet(this.petList).then(response => { - this.$modal.msgSuccess("淇敼鎴愬姛"); - // this.open = false; - this.btn=false - }); - } else { - this.$modal.msgSuccess("淇敼澶辫触"); - - } - } + uploadPic(formData).then(response => { + let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) + _this.fileList1.push({name:response.data.fileName, url:response.data.url}) + console("ok") }) + + }, + requestUpload2(params) + { + var file = params.file; + var formData = new FormData(); + + formData.append('uploadFile', file); + let _this = this + + uploadPic(formData).then(response => { + let pth = response.data.originalFilename.substr(response.data.originalFilename.length-4, response.data.originalFilename.length) + _this.fileList2.push({name:response.data.fileName, url:response.data.url}) + console("ok") + }) + + }, + submitForm() { + + let ul = this.fileList1.map(function (elem){ + return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }).join(",") + let uls = this.fileList2.map(function (elem){ + return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") + }).join(",") + this.petList.headPicture = ul, + this.petList.fullPicture = uls, + this.$refs['elForm'].validate(valid => { + + + if (valid) { + if (this.petList.id != undefined) { + updatePet(this.petList).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + // this.open = false; + this.btn=false + }); + } else { + this.$modal.msgSuccess("淇敼澶辫触"); + + } + } + }) }, @@ -545,8 +587,9 @@ /** 澶囧繕褰� */ Petnote(pid){ - this.openDataScope = true - this.getList() + const id = this.$route.params && this.$route.params.id; + this.$router.push("/familymodel/pet/petnote/" + id ); + }, handlePictureCardPreview(file) { this.dialogFileUrl = file.url; @@ -625,6 +668,12 @@ display: block; } +.hide .el-upload--picture-card { + display: none; +} +.form{ + background:center/11% no-repeat url('../../assets/icons/form.png') ; +} .pt{ right: 50px; top:-3px; -- Gitblit v1.9.1