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 | 475 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 343 insertions(+), 132 deletions(-) diff --git a/ruoyi-ui/src/views/pet/petInfo.vue b/ruoyi-ui/src/views/pet/petInfo.vue index 782ece2..8d1b52c 100644 --- a/ruoyi-ui/src/views/pet/petInfo.vue +++ b/ruoyi-ui/src/views/pet/petInfo.vue @@ -1,15 +1,29 @@ <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" class="pt" icon="el-icon-edit" @click="handleEdit()" :disabled="btn">缂栬緫</el-button> - <el-button type="primary" @click="Petnote(id)" :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 > <div > <el-container > - <el-col > + <el-col > <el-form ref="elForm" :model="petList" :rules="rules" size="medium" label-position="left" v-loading="loading" :data="petList" @selection-change="handleSelectionChange" label-width="120px" > <el-row :span="5"> @@ -105,6 +119,9 @@ </el-input> </el-form-item> </el-row> + <el-form-item size="large"> + + </el-form-item> </el-form> </el-col> </el-container> @@ -112,17 +129,17 @@ <div style="padding-left:250px;padding-top:30px"> <el-col :span="6" :data="petList"> - <div class="block" :model="petList" > - <el-col v-model="petList.url" prop="url"> + <div class="block" :model="petList" > + <el-col v-model="petList.headPicture" prop="headPicture"> <el-avatar shape="square" :size=200 > <el-image - :src="'http://47.93.189.255:8080/'+ petList.url" - :fit="fit" style="width: 212px;height: 168px;border-radius: 0px 0px 0px 0px;opacity: 1;border: 1px solid rgba(0,0,0,0.5);" + :src="'http://47.93.189.255:8080/'+ petList.headPicture" + :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-avatar> - </el-col> - </div> - + </el-col> + </div> + <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼榄呭疇淇℃伅</el-button> </el-col> </div> </el-container> @@ -132,35 +149,20 @@ <el-container > <div > <el-container > - <el-col > - <el-form ref="elForm" :model="petownerList" :rules="rules" size="medium" label-position="left" - v-loading="loading" :data="petownerList" @selection-change="handleSelectionChange" label-width="120px" > + <el-col > + <el-form ref="elForm" :model="petList" :rules="rules" size="medium" label-position="left" + v-loading="loading" :data="petList" @selection-change="handleSelectionChange" label-width="120px" > <el-row :span="5"> - <el-form-item label="楗插吇浜哄鍚�" prop="name" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.name" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb" > + <el-form-item label="楗插吇浜哄鍚�" prop="masterName" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> + <el-input v-model="petList.masterName" placeholder="" clearable :style="{width: '100%'}" readonly unselectable="on" > </el-input> </el-form-item> </el-row> + + <el-row :span="5"> - <el-form-item label="鍥哄畾鐢佃瘽" prop="fixedNo" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.fixedNo" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-row> - <el-row :span="5"> - <el-form-item label="绉诲姩鐢佃瘽" prop="birth" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.birth" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-row> - <el-row :span="5"> - <el-form-item label="浣忔墍鎬ц川" prop="property" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.property" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-row> - <el-form-item label="浣忔墍璇︾粏鍦板潃" prop="address" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.address" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-form-item label="浣忔墍璇︾粏鍦板潃" prop="masterAddress" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> + <el-input v-model="petList.masterAddress" placeholder="" clearable :style="{width: '100%'}" readonly unselectable="on"> </el-input> </el-form-item> </el-row> @@ -171,48 +173,174 @@ <div style="padding-left:150px"> <el-container> - <el-col v-loading="loading" :data="petownerList" @selection-change="handleSelectionChange"> - <el-form ref="elForm" :model="petownerList" :rules="rules" size="medium" label-position="left" > + <el-col v-loading="loading" :data="petList" @selection-change="handleSelectionChange"> + <el-form ref="elForm" :model="petList" :rules="rules" size="medium" label-position="left" > + <el-row :span="5"> - <el-form-item label="璇佷欢绫诲瀷" prop="certificateType" label-width="80px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.certificateType" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-form-item label="韬唤璇佸彿" prop="masterIdNum" label-width="80px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> + <el-input v-model="petList.masterIdNum" placeholder="" clearable :style="{width: '100%'}" readonly unselectable="on"> </el-input> </el-form-item> </el-row> <el-row :span="5"> - <el-form-item label="璇佷欢鍙风爜" prop="certificateNo" label-width="80px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.certificateNo" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-row> - <el-row :span="5"> - <el-form-item label="鎷ユ湁鐘彧鏁伴噺" prop="many" label-width="140px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.many " placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - </el-row> - <el-row :span="5"> - <el-form-item label="鐢靛瓙閭欢" prop="email" label-width="80px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> - <el-input v-model="petownerList.email" placeholder="" clearable :style="{width: '100%'}" :disabled="dsb"> + <el-form-item label="绉诲姩鐢佃瘽" prop="phone" label-width="100px" style="background: #FAD1E0;border-radius: 6px 6px 0px 6px;opacity: 1;"> + <el-input v-model="petList.phone" placeholder="" clearable :style="{width: '100%'}" readonly unselectable="on"> </el-input> </el-form-item> </el-row> + <el-form-item size="large"> + + </el-form-item> </el-form> </el-col> </el-container> </div> - </el-container> + + <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> + <div style="padding-left:50px;width: 1000px;;height: 500px;"> + <el-col :span="6" :data="petList"> + <div class="block" :model="petList" > + <el-col v-model="petList.fullPicture" prop="fullPicture"> + <el-avatar shape="square" style="width: 1000px;;height: 500px;" > + <el-image + :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>淇敼</el-button> + </el-col> + </div> + + + + <el-dialog :visible.sync="dialogVisible"> <img w-full :src="dialogImageUrl" alt="Preview Image" /> </el-dialog> + + <el-dialog :title="title" :visible.sync="openDataScope" width="1000px" append-to-body> + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['system:role:add']" + >鏂板</el-button> + </el-col> + + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['system:role:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['family:note:export']" + >瀵煎嚭</el-button> + </el-col> + + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['family:note:export']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + <el-col :span="1.2"> + <el-upload + action="" + class="upload-demo" + :show-file-list="false" + :http-request="handleEnport" + > + <el-button size="mini" type="primary" + plain + icon="el-icon-plus" >瀵煎叆</el-button> + + </el-upload> + </el-col> + + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + <el-table v-loading="loading" :data="PetNoteList" @selection-change="handleSelectionChange" @row-click="handleCheck" :row-class-name="tableRowClassName" > + <el-table-column type="selection" width="55" align="center" /> + + <el-table-column label="搴忓彿" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="120"/> + + <el-table-column label="棰樺悕" prop="title" sortable :show-overflow-tooltip="true" width="150" /> + <el-table-column label="鎻愰啋鏃堕棿" prop="remindTime" sortable :show-overflow-tooltip="true" width="150" /> + <el-table-column label="璁板綍鏃堕棿" prop="createTime" sortable :show-overflow-tooltip="true" width="150" /> + + <el-table-column label="澶囨敞" prop="remark" sortable width="100" /> + + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope" v-if="scope.row.roleId !== 1"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['familymodel:property:info']" + >淇敼</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['system:role:remove']" + >鍒犻櫎</el-button> + <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['familymodel:property:info']"> + <el-button size="mini" type="text" icon="el-icon-d-arrow-right" @click="handleCheck(scope.row)">鏌ョ湅璇︽儏</el-button> + + </el-dropdown> + </template> + </el-table-column> + </el-table> + + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + + /> + + + </el-dialog> + </div> </template> <script> -import {getPetList, getPetownerList, uploadPic, download} 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"; @@ -229,10 +357,34 @@ fileList:[ ], fileListOther:[ - ], dsb:true, btn:false, + isShow:true, + // 鎬绘潯鏁� + total: 0, + queryParams: { + pageNum: 1, + pageSize: 10, + title:undefined, + remindTime:undefined, + createTime:undefined, + remark:undefined, + url:undefined, + happenStartTime:undefined, + happenEndTime:undefined + }, + pid:undefined, + title: '榄呭疇澶囧繕褰�', + openDataScope: false, + PetNoteList:{ + pid:undefined, + title:undefined, + remide_time:undefined, + create_time:undefined, + remark:undefined, + url:undefined, + }, petList: { type: undefined, kind: undefined, @@ -243,30 +395,13 @@ remark: undefined, url: undefined, }, - petownerList: { - email: undefined, - name: undefined, - certificateType: undefined, - certificateNo: undefined, - fixedNo:undefined, - many:undefined, - address: undefined, - property: undefined, - }, - dialogImageUrl: '', - dialogVisible: false, - disabled: false, + + dialogImageUrl: '', + dialogVisible: false, + disabled: false, rules: { - idNum: [{ - required: true, - message: '璇疯緭鍏dNum', - trigger: 'blur' - }], - kind: [{ - required: true, - message: '璇烽�夋嫨淇濇磥/鏀剁撼', - trigger: 'change' - }], + + type: [{ required: true, message: '璇疯緭鍏ョ被鍒�', @@ -300,7 +435,8 @@ 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) { @@ -313,63 +449,123 @@ else{ document.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅"; this.$route.meta.title = "鏌ョ湅榄呭疇璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + this.btn = false; } let _this = this + if (id) { this.loading = true; getPetList(id).then((response) => { this.petList = response.data; - console.log(response.data) - + console.log(this.petList) this.loading = false; }); - this.getCateInfor() + // getPetowner(id).then((response) => { + // this.petownerList = response.data; + // this.loading = false; + // }); - }; - if (id) { - this.loading = true; - getPetownerList(id).then((response) => { - this.petownerList = response.data; - console.log(response.data) - - this.loading = false; + } - }); - this.getCateInfor() - - }; - this.getList(); }, mounted() {}, methods: { + getList() { + this.loading = true; + // this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0] + // this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1] + + // console.log(this.queryParams) + this.queryParams.pid = this.pid; + // listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => { + listPetnote(this.queryParams).then(response => { + // alert(123) + // console.log(response.data) + this.PetNoteList = response.data.data; + this.total = response.data.total; + this.loading = false; + } + ); + }, + requestUpload(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.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.fileList.map(function (elem){ + + let ul = this.fileList1.map(function (elem){ return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") }).join(",") - let uls = this.fileListOther.map(function (elem){ + let uls = this.fileList2.map(function (elem){ return elem.url.replace(process.env.VUE_APP_BASE_TRUE_API,"") - }).join(",") - this.formData.url = ul+","+uls - - this.$refs['elForm'].validate(valid => { + }).join(",") + this.petList.headPicture = ul, + this.petList.fullPicture = uls, + this.$refs['elForm'].validate(valid => { - if (valid) { - if (this.formData.id != undefined) { - updateEconomy(this.formData).then(response => { - this.$modal.msgSuccess("淇敼鎴愬姛"); - // this.open = false; - this.btn=false - }); - } else { - this.$modal.msgSuccess("淇敼澶辫触"); + 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("淇敼澶辫触"); + } } - } - }) + }) }, + + + /** 鏌ョ湅璇︾粏淇℃伅 */ + handleCheck(row){ + const id = row.id; + this.$router.push("/familymodel/pet/petnote/" + id); + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + const id = row.id; + let jd = true + + this.$router.push({ + path:"/familymodel/pet/petnote/" + id, + query:{ + detail:jd + } + }); + }, + resetForm() { this.$refs['elForm'].resetFields() }, @@ -388,17 +584,26 @@ }, - /** 澶囧繕褰� */ - Petnote(pid){ - this.$router.push("/familymodel/pet/petnote/" + pid); + /** 澶囧繕褰� */ + Petnote(pid){ + + const id = this.$route.params && this.$route.params.id; + this.$router.push("/familymodel/pet/petnote/" + id ); + }, - handlePictureCardPreview(file) { - this.dialogFileUrl = file.url; + handlePictureCardPreview(file) { + this.dialogFileUrl = file.url; const Base64 = require('js-base64').Base64 this.desurl = process.env.VUE_APP_BASE_OTHER_API+'onlinePreview?url='+encodeURIComponent(Base64.encode(this.dialogFileUrl)); myWindow=window.open(this.desurl,'','width=1200,height=800,top=150,left=300'); - }, + }, + /** 鏂板澶囧繕褰曟寜閽搷浣� */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "娣诲姞澶囧繕褰曡缁嗕俊鎭�"; + }, //鍒犻櫎鍥剧墖 handleRemoveFile(file,) { @@ -408,19 +613,19 @@ this.$delete(this.fileListOther,i); } }, - handleDownload(url) { - var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")}; + handleDownload(url) { + var formData = {'path':"/"+url.replace(process.env.VUE_APP_BASE_TRUE_API,"")}; - let lens = formData.path.split(".") - let suffix = lens[lens.length-1] - download(formData).then(async (response) => { - const isLogin = await blobValidate(response); - let nt = new Date().getTime() - let filename = 'property_'+nt+'.'+suffix - const blob = new Blob([response]) - saveAs(blob, filename) - }) - }, + let lens = formData.path.split(".") + let suffix = lens[lens.length-1] + download(formData).then(async (response) => { + const isLogin = await blobValidate(response); + let nt = new Date().getTime() + let filename = 'property_'+nt+'.'+suffix + const blob = new Blob([response]) + saveAs(blob, filename) + }) + }, handleEdit() { this.dsb = false @@ -463,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