器官编辑的比对国家表自动排序功能和新写了个附件预览的组件
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div v-if="visible" class="custom-image-viewer"> |
| | | <!-- é®ç½©å± --> |
| | | <div class="el-image-viewer__mask" @click.self="handleMaskClick"></div> |
| | | |
| | | <!-- å¾çé¢è§ä¸»ä½ --> |
| | | <div class="el-image-viewer__btn el-image-viewer__close" @click="close"> |
| | | <i class="el-icon-close"></i> |
| | | </div> |
| | | |
| | | <!-- ä¸ä¸å¼ æé® --> |
| | | <div |
| | | class="el-image-viewer__btn el-image-viewer__prev" |
| | | :class="{ 'is-disabled': isFirst }" |
| | | @click="goPrev" |
| | | > |
| | | <i class="el-icon-arrow-left"></i> |
| | | </div> |
| | | |
| | | <!-- ä¸ä¸å¼ æé® --> |
| | | <div |
| | | class="el-image-viewer__btn el-image-viewer__next" |
| | | :class="{ 'is-disabled': isLast }" |
| | | @click="goNext" |
| | | > |
| | | <i class="el-icon-arrow-right"></i> |
| | | </div> |
| | | |
| | | <!-- å¾çå±ç¤º --> |
| | | <div class="el-image-viewer__canvas"> |
| | | <img |
| | | v-if="currentUrl" |
| | | :src="currentUrl" |
| | | :key="currentIndex" |
| | | @error="handleError" |
| | | class="el-image-viewer__img" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- èªå®ä¹æç¤ºä¿¡æ¯ --> |
| | | <div v-if="showTip" class="custom-viewer-tip"> |
| | | {{ tipMessage }} |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'CustomImageViewer', |
| | | props: { |
| | | urlList: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | initialIndex: { |
| | | type: Number, |
| | | default: 0 |
| | | }, |
| | | visible: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | currentIndex: this.initialIndex, |
| | | showTip: false, |
| | | tipMessage: '' |
| | | }; |
| | | }, |
| | | computed: { |
| | | currentUrl() { |
| | | return this.urlList[this.currentIndex]; |
| | | }, |
| | | isFirst() { |
| | | return this.currentIndex === 0; |
| | | }, |
| | | isLast() { |
| | | return this.currentIndex === this.urlList.length - 1; |
| | | } |
| | | }, |
| | | watch: { |
| | | initialIndex(newVal) { |
| | | this.currentIndex = newVal; |
| | | }, |
| | | visible(newVal) { |
| | | if (!newVal) { |
| | | this.showTip = false; |
| | | this.tipMessage = ''; |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | close() { |
| | | this.$emit('update:visible', false); |
| | | this.$emit('close'); |
| | | }, |
| | | handleMaskClick() { |
| | | this.close(); |
| | | }, |
| | | goPrev() { |
| | | if (this.isFirst) { |
| | | this.showTipMessage('è¿å·²ç»æ¯ç¬¬ä¸å¼ äº'); |
| | | return; |
| | | } |
| | | this.currentIndex--; |
| | | this.hideTip(); |
| | | }, |
| | | goNext() { |
| | | if (this.isLast) { |
| | | this.showTipMessage('è¿å·²ç»æ¯æåä¸å¼ äº'); |
| | | return; |
| | | } |
| | | this.currentIndex++; |
| | | this.hideTip(); |
| | | }, |
| | | showTipMessage(message) { |
| | | this.tipMessage = message; |
| | | this.showTip = true; |
| | | // 2ç§åèªå¨éèæç¤º |
| | | setTimeout(() => { |
| | | this.hideTip(); |
| | | }, 2000); |
| | | }, |
| | | hideTip() { |
| | | this.showTip = false; |
| | | this.tipMessage = ''; |
| | | }, |
| | | handleError() { |
| | | console.error(`å¾çå 载失败: ${this.currentUrl}`); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .custom-image-viewer { |
| | | position: fixed; |
| | | top: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | z-index: 2000; /* ç¡®ä¿ z-index è¶³å¤é« */ |
| | | } |
| | | |
| | | .el-image-viewer__mask { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | | .el-image-viewer__btn { |
| | | position: absolute; |
| | | z-index: 1; |
| | | color: #fff; |
| | | background-color: rgba(0, 0, 0, 0.3); |
| | | border-radius: 50%; |
| | | width: 40px; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | user-select: none; |
| | | } |
| | | |
| | | .el-image-viewer__btn.is-disabled { |
| | | cursor: not-allowed; |
| | | opacity: 0.5; |
| | | } |
| | | |
| | | .el-image-viewer__close { |
| | | top: 20px; |
| | | right: 20px; |
| | | } |
| | | |
| | | .el-image-viewer__prev { |
| | | left: 20px; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | } |
| | | |
| | | .el-image-viewer__next { |
| | | right: 20px; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | } |
| | | |
| | | .el-image-viewer__canvas { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | height: 100%; |
| | | } |
| | | |
| | | .el-image-viewer__img { |
| | | max-width: 90%; |
| | | max-height: 90%; |
| | | object-fit: contain; |
| | | } |
| | | |
| | | .custom-viewer-tip { |
| | | position: absolute; |
| | | bottom: 50px; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | background-color: rgba(0, 0, 0, 0.7); |
| | | color: #fff; |
| | | padding: 10px 20px; |
| | | border-radius: 4px; |
| | | z-index: 2001; |
| | | } |
| | | </style> |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="å¨å®ç¼å·" |
| | | align="center" |
| | | width="90" |
| | | prop="organno" |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | label="åé
ç³»ç»ç¼å·" |
| | | align="center" |
| | |
| | | <el-table-column |
| | | label="ç§»æ¤å»é¢" |
| | | align="center" |
| | | width="230" |
| | | width="280" |
| | | prop="transplanthospitalno" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | <el-col :span="6"> |
| | | <el-form-item |
| | | align="left" |
| | | label="ç¾åæ¶é´" |
| | | label="ç¾åæ¥æ" |
| | | label-width="120px" |
| | | prop="coordinatorSignTime" |
| | | > |
| | |
| | | clearable |
| | | v-model="witnessform.coordinatorSignTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="éæ©ææ¯ç»ææ¶é´" |
| | | > |
| | | </el-date-picker> |
| | |
| | | <el-row> |
| | | <el-col> |
| | | <el-form-item> |
| | | <el-table v-loading="loading" border :data="procureddata"> |
| | | <el-table |
| | | v-loading="loading" |
| | | border |
| | | :key="tableKey" |
| | | :data="procureddata" |
| | | > |
| | | <el-table-column |
| | | label="å¨å®åç§°" |
| | | align="center" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="å¨å®ç¼å·" |
| | | align="center" |
| | | width="90" |
| | | prop="organno" |
| | | /> |
| | | /> --> |
| | | <!-- <el-table-column |
| | | label="ç³»ç»ç¼å·" |
| | | align="center" |
| | |
| | | <el-table-column |
| | | label="è·åå»é¢" |
| | | align="center" |
| | | width="230" |
| | | width="280" |
| | | prop="gainhospitalno" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="å¨å®ç¼å·" |
| | | align="center" |
| | | width="90" |
| | | prop="organno" |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | label="ç³»ç»ç¼å·" |
| | | align="center" |
| | |
| | | <el-table-column |
| | | label="ç§»æ¤å»é¢" |
| | | align="center" |
| | | width="220" |
| | | width="280" |
| | | prop="hospitalno" |
| | | > |
| | | <template slot-scope="scope"> |
| | |
| | | contacttime: "", |
| | | reporttime: "" |
| | | }, |
| | | organOrder: [ |
| | | "èè", |
| | | "å·¦è¾", |
| | | "å³è¾", |
| | | "å¿è", |
| | | "å·¦èº", |
| | | "å³èº", |
| | | "è°è
º", |
| | | "å°è ", |
| | | "å·¦ç¼è§è", |
| | | "å³ç¼è§è" |
| | | ], // æå®çå¨å®é¡ºåº |
| | | isSorting: false, // æ å¿ä½ï¼è¡¨ç¤ºæ¯å¦æ£å¨æåº |
| | | tableKey: 0, |
| | | istb: false, |
| | | activeName: "", |
| | | tableDatafile: [ |
| | |
| | | listReportname("fzr").then(res => { |
| | | this.leaderlist = res.data; |
| | | }); |
| | | // this.customOrganSort(); |
| | | }, |
| | | watch: { |
| | | // çå¬ procureddata çååï¼æ°æ®æ´æ°åéæ°æåº |
| | | procureddata: { |
| | | handler(newVal) { |
| | | if (this.isSorting) { |
| | | return; |
| | | } |
| | | this.customOrganSort(); |
| | | }, |
| | | deep: true // 深度çå¬ï¼å 为æ°ç»å
容å¯è½åå |
| | | }, |
| | | allocateddata: { |
| | | handler(newVal) { |
| | | if (this.isSorting) { |
| | | return; |
| | | } |
| | | this.allocateddataSort(); |
| | | }, |
| | | deep: true // 深度çå¬ï¼å 为æ°ç»å
容å¯è½åå |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | customOrganSort() { |
| | | console.log("è°ç¨"); |
| | | |
| | | // 1. å éï¼é»æ¢çå¬å¨æ§è¡ |
| | | this.isSorting = true; |
| | | // èªå®ä¹æåºå½æ° |
| | | this.procureddata.sort((a, b) => { |
| | | const indexA = this.organOrder.indexOf(a.organname); |
| | | const indexB = this.organOrder.indexOf(b.organname); |
| | | |
| | | // å¦æä¸¤ä¸ªé½å¨å表ä¸ï¼æå表ä¸çé¡ºåºæåº |
| | | if (indexA !== -1 && indexB !== -1) { |
| | | return indexA - indexB; |
| | | } |
| | | // 妿 a å¨å表ä¸ï¼b ä¸å¨ï¼a æåé¢ |
| | | if (indexA !== -1) { |
| | | return -1; |
| | | } |
| | | // 妿 b å¨å表ä¸ï¼a ä¸å¨ï¼b æåé¢ |
| | | if (indexB !== -1) { |
| | | return 1; |
| | | } |
| | | // 两个é½ä¸å¨å表ä¸ï¼ä¿æå顺åºï¼ææå
¶ä»è§åï¼æ¯å¦æåæ¯æåºï¼è¿éæåå§é¡ºåºï¼ |
| | | return 0; |
| | | }); |
| | | console.log(this.procureddata, "顺åº"); |
| | | this.tableKey += 1; // æ¹å key è¿«ä½¿è¡¨æ ¼éæ°æ¸²æ |
| | | // ä½ å¯ä»¥ä½¿ç¨ this.$forceUpdate() æè
éæ°èµå¼æ°ç»æ¥è§¦åæ´æ° |
| | | this.procureddata = [...this.procureddata]; |
| | | this.$nextTick(() => { |
| | | this.isSorting = false; |
| | | }); |
| | | }, |
| | | allocateddataSort() { |
| | | console.log("è°ç¨"); |
| | | |
| | | // 1. å éï¼é»æ¢çå¬å¨æ§è¡ |
| | | this.isSorting = true; |
| | | // èªå®ä¹æåºå½æ° |
| | | this.allocateddata.sort((a, b) => { |
| | | const indexA = this.organOrder.indexOf(a.organname); |
| | | const indexB = this.organOrder.indexOf(b.organname); |
| | | |
| | | // å¦æä¸¤ä¸ªé½å¨å表ä¸ï¼æå表ä¸çé¡ºåºæåº |
| | | if (indexA !== -1 && indexB !== -1) { |
| | | return indexA - indexB; |
| | | } |
| | | // 妿 a å¨å表ä¸ï¼b ä¸å¨ï¼a æåé¢ |
| | | if (indexA !== -1) { |
| | | return -1; |
| | | } |
| | | // 妿 b å¨å表ä¸ï¼a ä¸å¨ï¼b æåé¢ |
| | | if (indexB !== -1) { |
| | | return 1; |
| | | } |
| | | // 两个é½ä¸å¨å表ä¸ï¼ä¿æå顺åºï¼ææå
¶ä»è§åï¼æ¯å¦æåæ¯æåºï¼è¿éæåå§é¡ºåºï¼ |
| | | return 0; |
| | | }); |
| | | console.log(this.allocateddata, "顺åº"); |
| | | this.tableKey += 1; // æ¹å key è¿«ä½¿è¡¨æ ¼éæ°æ¸²æ |
| | | // ä½ å¯ä»¥ä½¿ç¨ this.$forceUpdate() æè
éæ°èµå¼æ°ç»æ¥è§¦åæ´æ° |
| | | this.allocateddata = [...this.allocateddata]; |
| | | this.$nextTick(() => { |
| | | this.isSorting = false; |
| | | }); |
| | | }, |
| | | // 忢tab |
| | | on_click(e) { |
| | | // if (e != "" || e != null) { |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="selectionType == 'account' && accountfrom == '2'&& |
| | | accountselectform.usertype == 'org'"> |
| | | <el-row |
| | | v-if=" |
| | | selectionType == 'account' && |
| | | accountfrom == '2' && |
| | | accountselectform.usertype == 'org' |
| | | " |
| | | > |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç¨å·" prop="unitTaxNo"> |
| | | <el-input |
| | |
| | | > |
| | | <!-- <img :src="pdfimg" /> --> |
| | | <el-image |
| | | ref="imagePreview" |
| | | style="width: 95%; height: 90%" |
| | | @error="handleImageError" |
| | | @load="handleImageLoad" |
| | | :src="pdfimg" |
| | | :preview-src-list="pdfimgsrcList" |
| | | @click="handleImageClick(initialIndex)" |
| | | > |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="pdfimgsrcList" |
| | | :initial-index="currentIndex" |
| | | :visible="viewerVisible" |
| | | @update:visible="viewerVisible = $event" |
| | | @close="handleViewerClose" |
| | | /> |
| | | </div> |
| | | <div v-else class="pdfimgmins">{{ hintitle }}</div> |
| | | </div> |
| | |
| | | import Li_area_select from "@/components/Address"; |
| | | import OrgSelecter from "@/views/project/components/orgselect"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import CustomImageViewer from "@/components/CustomImageViewer"; // æ ¹æ®ä½ çè·¯å¾è°æ´ |
| | | |
| | | |
| | | export default { |
| | | //importå¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { |
| | | Li_area_select, |
| | | OrgSelecter |
| | | OrgSelecter, |
| | | CustomImageViewer, |
| | | }, |
| | | name: "fundApply", |
| | | |
| | |
| | | username: [ |
| | | { required: true, message: "请è¾å
¥è´¦æ·åç§°", trigger: "blur" } |
| | | ], |
| | | unitTaxNo: [ |
| | | { required: true, message: "请è¾å
¥ç¨å·", trigger: "blur" } |
| | | ], |
| | | unitTaxNo: [{ required: true, message: "请è¾å
¥ç¨å·", trigger: "blur" }], |
| | | idcardno: [ |
| | | { required: true, message: "请è¾å
¥èº«ä»½è´¦å·", trigger: "blur" } |
| | | ], |
| | |
| | | pdftitle: "", |
| | | pdfimg: "", |
| | | pdfimgsrcList: [], |
| | | currentIndex: 0, // åå§ç´¢å¼ |
| | | initialIndex: 0, // åå§ç´¢å¼ |
| | | viewerVisible: false, // æ§å¶é¢è§ç»ä»¶æ¾ç¤º |
| | | pdfVisible: false, |
| | | previewpdf: false, |
| | | hintitle: "请ä¸ä¼ æä»¶åæ¥ç", |
| | |
| | | if ( |
| | | this.userprofile.userName == "admin" || |
| | | this.userprofile.userName == "053" || |
| | | this.userprofile.userName == "047"|| store.getters.rolesor[0].roleSort=='13' |
| | | this.userprofile.userName == "047" || |
| | | store.getters.rolesor[0].roleSort == "13" |
| | | ) { |
| | | this.ismanager = true; |
| | | } else { |
| | |
| | | // å¾çå è½½æåæ¶æ§è¡çæä½ |
| | | console.log("Image loaded successfully"); |
| | | }, |
| | | handleImageClick(index) { |
| | | this.currentIndex = index; |
| | | this.viewerVisible = true; |
| | | }, |
| | | handleViewerClose() { |
| | | this.viewerVisible = false; |
| | | }, |
| | | handleUploadError() {}, |
| | | remove(file, fileList) { |
| | | const rbDetails = [...this.rbDetails]; |
| | |
| | | ref="imagePreview" |
| | | style="width: 95%; height: 90%" |
| | | :src="pdfimg" |
| | | :preview-src-list="pdfimgsrcList" |
| | | :initial-index="initialIndex" |
| | | @error="handleImageError" |
| | | @load="handleImageLoad" |
| | | @click="handleImageClick(initialIndex)" |
| | | > |
| | | </el-image> |
| | | <custom-image-viewer |
| | | :url-list="pdfimgsrcList" |
| | | :initial-index="currentIndex" |
| | | :visible="viewerVisible" |
| | | @update:visible="viewerVisible = $event" |
| | | @close="handleViewerClose" |
| | | /> |
| | | <!-- <div slot="error" class="image-slot"> |
| | | <i class="el-icon-picture-outline"></i> |
| | | </div> --> |
| | |
| | | import { getInfoBytheUserNo } from "@/api/project/externalperson"; |
| | | import { regionDataPlus, CodeToText } from "element-china-area-data"; |
| | | import Li_area_select from "@/components/Address"; |
| | | import CustomImageViewer from "@/components/CustomImageViewer"; // æ ¹æ®ä½ çè·¯å¾è°æ´ |
| | | import { getUser, getUserProfile } from "@/api/system/user"; |
| | | import { treeselect } from "@/api/system/dept"; |
| | | import { getSubsidy } from "@/api/project/travelcity"; |
| | |
| | | components: { |
| | | Treeselect, |
| | | Li_area_select, |
| | | CustomImageViewer, |
| | | pdf |
| | | }, |
| | | name: "Funddetail", |
| | |
| | | invoicefileListto: [], |
| | | invoicepdfimg: "", |
| | | invoicepdfimgsrcList: [], |
| | | currentIndex: 0, // åå§ç´¢å¼ |
| | | initialIndex: 0, // åå§ç´¢å¼ |
| | | viewerVisible: false, // æ§å¶é¢è§ç»ä»¶æ¾ç¤º |
| | | //人åç±»å« |
| | | persontype: null, |
| | | //å°è¾¾å° |
| | |
| | | } |
| | | return 0; |
| | | }, |
| | | handleImageClick(index) { |
| | | this.currentIndex = index; |
| | | this.viewerVisible = true; |
| | | }, |
| | | handleViewerClose() { |
| | | this.viewerVisible = false; |
| | | }, |
| | | handleImageError() { |
| | | console.error("å¾çå 载失败"); |
| | | }, |