From a85494cc5769c3dab7f210c012fba1c45103e779 Mon Sep 17 00:00:00 2001 From: feige <feige@qq.com> Date: 星期二, 06 六月 2023 16:16:55 +0800 Subject: [PATCH] 修改了不会重复页面的一些bug --- ruoyi-ui/src/views/doctor/doctorInfo.vue | 224 +++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 158 insertions(+), 66 deletions(-) diff --git a/ruoyi-ui/src/views/doctor/doctorInfo.vue b/ruoyi-ui/src/views/doctor/doctorInfo.vue index 0ec6975..e469830 100644 --- a/ruoyi-ui/src/views/doctor/doctorInfo.vue +++ b/ruoyi-ui/src/views/doctor/doctorInfo.vue @@ -2,50 +2,80 @@ <div class="app-container"> <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 v-if="isShow" type="primary" class="pt" icon="el-icon-edit" @click="handleEdit()" >缂栬緫</el-button>--> <!-- <br>--> <!-- <el-button type="primary" class="pt" @click="handleExport"--> <!-- v-hasPermi="['self:user:export']" >瀵煎嚭</el-button>--> </div> - - <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"> + <div> + <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-position="left" label-width="100px"> <!-- <el-form-item label="id" prop="id">--> <!-- <el-input v-model="formData.id" placeholder="璇疯緭鍏d" :maxlength="11" show-word-limit :disabled="true"--> <!-- clearable prefix-icon='el-icon-mobile' :style="{width: '100%'}"></el-input>--> <!-- </el-form-item>--> - <el-form-item label="绫诲瀷" prop="type"> - <el-input v-model="formData.type" placeholder="璇疯緭鍏ョ被鍨�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="鐥囩姸" prop="symptom"> - <el-input v-model="formData.symptom" placeholder="璇疯緭鍏ョ棁鐘�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="鎸佺画鏃堕棿" prop="duration"> - <el-input v-model="formData.duration" placeholder="璇疯緭鍏ユ寔缁椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="涓尰澶勬柟" prop="cmedical"> - <el-input v-model="formData.cmedical" placeholder="璇疯緭鍏ヤ腑鍖诲鏂�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="瑗垮尰澶勬柟" prop="wmedical"> - <el-input v-model="formData.wmedical" placeholder="璇疯緭鍏ヨタ鍖诲鏂�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="鍔熸晥" prop="effect"> - <el-input v-model="formData.effect" placeholder="璇疯緭鍏ュ姛鏁�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - <el-form-item label="閫傜敤浜�" prop="suitable"> - <el-input v-model="formData.suitable" placeholder="璇疯緭鍏ラ�傜敤浜�" clearable :style="{width: '100%'}" :disabled="dsb"> - </el-input> - </el-form-item> - - <el-form-item label="澶囨敞" prop="remark"> - <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> - </el-form-item> - + <el-container> + <div> + <el-container> + <el-row> + <el-cow :span="8"> + <el-form-item label="绫诲瀷" prop="type" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-select v-model="formData.type" placeholder="璇烽�夋嫨绫诲埆" clearable :style="{width: '100%'}" > + <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value" + ></el-option> + </el-select> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="鐥囩姸" prop="symptom" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.symptom" placeholder="璇疯緭鍏ョ棁鐘�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="鎸佺画鏃堕棿" prop="duration" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.duration" placeholder="璇疯緭鍏ユ寔缁椂闂�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="鍔熸晥" prop="effect" label-width="50px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.effect" placeholder="璇疯緭鍏ュ姛鏁�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="閫傜敤浜�" prop="suitable" label-width="65px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.suitable" placeholder="璇疯緭鍏ラ�傜敤浜�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="澶囨敞" prop="remark" label-width="45px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" clearable :style="{width: '100%'}" :disabled="dsb"></el-input> + </el-form-item> + </el-cow> + </el-row> + </el-container> + </div> + <div style="padding-left:120px"> + <el-container> + <el-row> + <el-cow :span="8"> + <el-form-item label="涓尰澶勬柟" prop="cmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.cmedical" placeholder="璇疯緭鍏ヤ腑鍖诲鏂�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + <el-cow :span="8"> + <el-form-item label="瑗垮尰澶勬柟" prop="wmedical" label-width="68px" style="background: #FAD1E0;border-radius: 7px 7px 7px 7px;opacity: 1;"> + <el-input v-model="formData.wmedical" placeholder="璇疯緭鍏ヨタ鍖诲鏂�" clearable :style="{width: '100%'}" :disabled="dsb"> + </el-input> + </el-form-item> + </el-cow> + </el-row> + </el-container> + </div> + </el-container> <h4 class="form-header">鐢靛瓙鏂囦欢 </h4> <el-upload action="#" @@ -66,20 +96,21 @@ > <span class="el-upload-list__item-actions"> <span + v-if="isShow" class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)" > <i class="el-icon-zoom-in"></i> </span> <span - v-if="!disabled" + v-if="isShow" class="el-upload-list__item-delete" @click="handleDownload(file.url)" > <i class="el-icon-download"></i> </span> <span - v-if="!disabled" + v-if="isShow" class="el-upload-list__item-delete" @click="handleRemove(file)" > @@ -92,33 +123,65 @@ </el-upload> <h4 class="form-header">鍏朵粬闄勪欢 </h4> - <el-upload - action="" - :file-list="fileListOther" - class="upload-demo" - multiple - :on-preview="handlePreview" + <el-upload + action="" + :file-list="fileListOther" + class="upload-demo" + multiple + list-type="picture-card" + :on-preview="handleFileCardPreview" + :on-remove="handleRemove" + :http-request="requestUpload" + :show-file-list="true" + > - :on-remove="handleRemove" - :http-request="requestUpload" - :show-file-list="true" - > - <el-button type="primary">鐐瑰嚮涓婁紶</el-button> - <template #tip> - <div class="el-upload__tip"> - </div> - </template> + <i slot="default" class="el-icon-plus"></i> + <div slot="file" slot-scope="{file}"> + <img + class="el-upload-list__item-thumbnail" + src="../../assets/401_images/401.gif" + alt="" + style="width: 147px; height: 147px" + fit="cover" + > + <span class="el-upload-list__item-actions"> + <span + v-if="isShow" + class="el-upload-list__item-preview" + @click="handleFileCardPreview(file)" + > + <i class="el-icon-zoom-in"></i> + </span> + <span + v-if="isShow" + @click="handleRemove(file)" + class="el-upload-list__item-delete" + + > + <i class="el-icon-download"></i> + </span> + <span + v-if="isShow" + class="el-upload-list__item-delete" + @click="handleRemoveFile(file)" + > + <i class="el-icon-delete"></i> + </span> + </span> - </el-upload> + </div> + + + </el-upload> <el-form-item size="large"> - <el-button type="primary" @click="submitForm" :disabled="dsb">淇敼</el-button> + <el-button v-if="isShow" type="primary" @click="submitForm" :disabled="dsb">淇敼</el-button> </el-form-item> </el-form> - + </div> <el-dialog :visible.sync="dialogVisible"> - <img w-full :src="dialogImageUrl" alt="Preview Image" /> + <img w-full :src="dialogImageUrl" style="width: 700px; height: 700px" alt="Preview Image" /> </el-dialog> </div> </template> @@ -137,7 +200,7 @@ return { cdi:"灏卞尰璁板綍璇︾粏淇℃伅", udi:"灏卞尰璁板綍淇℃伅璇︽儏", - fot:[".jpg",".jif"], + fot:[".jpg",".jif","png"], fileList:[ ], fileListOther:[ @@ -145,7 +208,7 @@ ], dsb:true, btn:false, - + isShow:true, // 灏卞尰璁板綍琛ㄦ牸鏁版嵁 doctorList: [], @@ -209,7 +272,16 @@ }], }, - typeOptions: [], + typeOptions: [{ + value:'绁炵粡绉�', + label:'绁炵粡绉�' + },{ + value:'鐗欑', + label:'鐗欑' + },{ + value:'鍐呯', + label:'鍐呯' + }], } }, computed: {}, @@ -222,12 +294,14 @@ jd = this.$route.query.detail this.btn= jd this.dsb = !jd + this.isShow=true document.title = "淇敼灏卞尰璁板綍璇︾粏淇℃伅"; this.$route.meta.title = "淇敼灏卞尰璁板綍璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� } else{ - document.title = "鏌ョ湅灏卞尰璁板綍璇︾粏淇℃伅"; - this.$route.meta.title = "鏌ョ湅灏卞尰璁板綍璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + document.title = "灏卞尰璁板綍璇︾粏淇℃伅"; + this.$route.meta.title = "灏卞尰璁板綍璇︾粏淇℃伅";//鍒楄〃鐨勫悕绉� + this.isShow=true } let _this = this @@ -314,10 +388,24 @@ }) }, handleRemoveFile(file) { - alert(23) + for(let i = 0; i < this.fileListOther.length; i++) + { + if(this.fileListOther[i].url==file.url) + this.$delete(this.fileListOther,i); + } }, handleRemove(file) { - alert(323) + for(let i = 0; i < this.fileList.length; i++) + { + if(this.fileList[i].url==file.url) + this.$delete(this.fileList,i); + } + }, + handleFileCardPreview(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'); }, handlePictureCardPreview(file) { this.dialogImageUrl = file.url; @@ -331,7 +419,7 @@ download(formData).then(async (response) => { const isLogin = await blobValidate(response); let nt = new Date().getTime() - let filename = 'property_'+nt+'.'+suffix + let filename = 'doctor_'+nt+'.'+suffix const blob = new Blob([response]) saveAs(blob, filename) }) @@ -339,7 +427,8 @@ handleEdit() { this.dsb = false - this.btn = true + // this.btn = true + this.isShow=false }, requestUpload(params) { @@ -378,6 +467,9 @@ </script> <style scoped> +.app-container{ + background-color: #FEF7FC; +} .mt { position: relative; -- Gitblit v1.9.1