From 25bcf1541e231adc9992fff9ae9c361e66e3d711 Mon Sep 17 00:00:00 2001 From: Tcsm <1377977403@qq.com> Date: 星期一, 11 九月 2023 23:14:52 +0800 Subject: [PATCH] 模块添加打印功能,查看详情的页面去掉上传功能 --- ruoyi-ui/src/views/pet/index.vue | 217 ++++++++++++++++++++++++++---------------------------- 1 files changed, 105 insertions(+), 112 deletions(-) diff --git a/ruoyi-ui/src/views/pet/index.vue b/ruoyi-ui/src/views/pet/index.vue index be423ce..d374cd3 100644 --- a/ruoyi-ui/src/views/pet/index.vue +++ b/ruoyi-ui/src/views/pet/index.vue @@ -1,10 +1,10 @@ <template> <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> - <el-form-item label="绫诲瀷" prop="type"> + <el-form-item label="鎬у埆" prop="sex"> <el-select - v-model="queryParams.type" - placeholder="鎵�鏈夌被鍨�" + v-model="queryParams.sex" + placeholder="璇烽�夋嫨鎬у埆" clearable style="width: 240px" > @@ -33,24 +33,8 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="鎸佹湁浜�" prop="holder"> - <el-input - v-model="queryParams.holder" - placeholder="璇疯緭鍏ユ寔鏈変汉" - clearable - style="width: 240px" - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <!-- <el-form-item label="鍏蜂綋浣嶇疆" prop="address"> - <el-input - v-model="queryParams.address" - placeholder="璇疯緭鍏ュ叿浣撲綅缃�" - clearable - style="width: 240px" - @keyup.enter.native="handleQuery" - /> - </el-form-item> --> + + </el-form-item> <!-- <el-form-item label="鍙戠敓鏃堕棿"> <el-date-picker @@ -94,40 +78,7 @@ 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> @@ -153,6 +104,7 @@ </el-table-column> <el-table-column label="瀹犵墿id" prop="id" sortable width="100" /> + <el-table-column label="涓讳汉濮撳悕" prop="masterName" 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 @@ -205,11 +157,11 @@ <el-input v-model="formDat.name" placeholder="璇疯緭鍏ュ悕瀛�" clearable :style="{width: '100%'}" ></el-input> </el-form-item> <el-form-item label="鍑虹敓鏃ユ湡" prop="birth"> - <el-date-picker + <el-input v-model='formDat.birth' type='date' placeholder='閫夋嫨鏃ユ湡' - ></el-date-picker> + ></el-input> </el-form-item> <el-form-item label="鎬у埆" prop="sex"> <el-select v-model="formDat.sex" placeholder="璇烽�夋嫨鎬у埆" clearable :style="{width: '100%'}" > @@ -271,9 +223,9 @@ <el-upload action="#" list-type="picture-card" - multiple + :limit="1" :http-request="requestUpload" - :file-list="fileList" + :file-list="fileList1" > <i slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> @@ -309,9 +261,9 @@ <el-upload action="#" list-type="picture-card" - multiple - :http-request="requestUpload" - :file-list="fileList" + :limit="1" + :http-request="requestUpload2" + :file-list="fileList2" > <i slot="default" class="el-icon-plus"></i> <div slot="file" slot-scope="{file}"> @@ -334,13 +286,11 @@ <span v-if="!disabled" class="el-upload-list__item-delete" - @click="handleRemove(file)" + @click="handleRemoveFile(file)" > <i class="el-icon-delete"></i> </span> </span> - - </div> </el-upload> </el-form> @@ -389,7 +339,7 @@ showSearch: true, // 鎬绘潯鏁� total: 0, - // 璧勪骇琛ㄦ牸鏁版嵁 + petList: [], // 寮瑰嚭灞傛爣棰� title: "", @@ -405,11 +355,9 @@ dateRange: [], // 鏁版嵁鑼冨洿閫夐」 fot:[".jpg",".jif"], - fileList:[ - ], - fileListOther:[ - - ], + fileList1:[ ], + fileList2:[ ], + fileListOther:[ ], dsb:true, btn:false, formDat: { @@ -434,7 +382,8 @@ diseatHabit: undefined, LifeHabit: undefined, disLifeHabit: undefined, - url: undefined, + headPicture:undefined, + fullPicture:undefined, }, petList: { @@ -453,6 +402,8 @@ LifeHabit: undefined, disLifeHabit: undefined, url: undefined, + headPicture:undefined, + fullPicture:undefined, }, // 鑿滃崟鍒楄〃 @@ -490,7 +441,7 @@ trigger: 'blue' }], securityCode: [{ - required: true, + // required: true, message: '璇疯緭鍏ラ槻浼爜', trigger: 'blue' }], @@ -510,7 +461,7 @@ trigger: 'blue' }], properties: [{ - required: true, + // required: true, message: '璇疯緭鍏ユ�ц川', trigger: 'blue' }], @@ -521,13 +472,13 @@ }], LifeHabit: [{ - required: true, + // required: true, message: '璇疯緭鍏ョ敓娲讳範鎯�(鍠�)', trigger: 'blur' }], disLifeHabit: [{ - required: true, + // required: true, message: '璇疯緭鍏ョ敓娲讳範鎯�(鎭�)', trigger: 'blur' }], @@ -543,6 +494,27 @@ message: '璇疯緭鍏ラギ椋熶範鎯�(鍠�)', trigger: 'blur' }], + masterName: [{ + required: true, + message: '璇疯緭鍏ヤ富浜哄鍚�', + trigger: 'blur' + }], + masterIdNum: [{ + required: true, + message: '璇疯緭鍏ヤ富浜鸿韩浠借瘉鍙风爜', + trigger: 'blur' + }], + phone: [{ + required: true, + message: '璇疯緭鍏ユ墜鏈哄彿', + trigger: 'blur' + }], + masterAddress: [{ + required: true, + message: '璇疯緭鍏ヤ富浜哄湴鍧�', + trigger: 'blur' + }], + }, @@ -561,6 +533,8 @@ }, methods: { + + // 鍙栨秷鎸夐挳 cancelData() { this.open = false; @@ -614,8 +588,14 @@ ); }, - handleRemove(file) { + for(let i = 0; i < this.fileList.length; i++) + { + if(this.fileList[i].url==file.url) + this.$delete(this.fileList,i); + } + }, + handleRemoveFile(file) { for(let i = 0; i < this.fileListOther.length; i++) { if(this.fileListOther[i].url==file.url) @@ -699,52 +679,69 @@ }); }, - + //鏀惧ぇ handlePictureCardPreview(file) { this.dialogImageUrl = file.url; this.dialogVisible = true; }, + /** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */ submitDataScope: function() { - 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.formDat.url = ul+","+uls - this.$refs["elForm"].validate(valid => { - if (valid) { + this.formDat.headPicture = ul, + this.formDat.fullPicture = uls, + this.$refs["elForm"].validate(valid => { + if (valid) { - addPet(this.formDat).then(response => { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.open = false; - this.getList(); - }); - } + addPet(this.formDat).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + }); + // 娓呯┖formDat瀵硅薄鐨勬暟鎹� + Object.keys(this.formDat).forEach(key => { + this.formDat[key] = ''; }); + this.handleRemove(this.fileList[0]); + this.handleRemoveFile(this.fileListOther[0]); }, 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}) + // _this.fileList2.push({name:response.data.fileName, url:response.data.url}) + console("ok") + }) - if(_this.fot.includes(pth) === true) - { - _this.fileList.push({name:response.data.fileName, "url":response.data.url}) + }, + requestUpload2(params) + { + var file = params.file; + var formData = new FormData(); - } + formData.append('uploadFile', file); + let _this = this - else{ - _this.fileListOther.push({name:response.data.fileName, url:response.data.url}) - - } + 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}) + _this.fileList2.push({name:response.data.fileName, url:response.data.url}) + console("ok") }) }, @@ -758,29 +755,15 @@ this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }).catch(() => {}); }, + + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { this.download('family/pet/export', { ...this.queryParams }, `pet_${new Date().getTime()}.xlsx`) }, - /** 瀵煎叆鎿嶄綔*/ - handleEnport(params){ - var file = params.file; - var formData = new FormData(); - formData.append('excelImport', file); - let _this = this - alert(file) - enload(formData).then(response => { - _this.getList(); - Message({ message: "瀵煎叆鎴愬姛", type: 'warning' }) - }).catch(err) - { - Message({ message: "瀵煎叆澶辫触", type: 'error' }) - } - - } } }; </script> @@ -793,4 +776,14 @@ background: #FFEFF2; } +.upload-demo .el-upload-list__item-thumbnail img { + width: 100%; + height: 100%; + object-fit: cover; +} +.upload-demo .el-icon-plus { + font-size: 28px; + color: #999; + border: 1px dashed #999; +} </style> -- Gitblit v1.9.1