| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="ä¸æèµ è
å
³ç³»" prop="familyrelations"> |
| | | <el-form-item label="ä¸æèµ è
å
³ç³»" prop="signfamilyrelations"> |
| | | <el-select |
| | | v-model="form.familyrelations" |
| | | v-model="form.signfamilyrelations" |
| | | placeholder="è¯·éæ©ä¸æèµ è
å
³ç³»" |
| | | > |
| | | <el-option |
| | |
| | | relativeconfirmationsign: "0", |
| | | signdate: "", |
| | | relativeconfirmationsignname: "", |
| | | familyrelations: "", |
| | | signfamilyrelations: "", |
| | | relativeidcardno: "", |
| | | relativephone: "", |
| | | relativeRemark: "", |
| | |
| | | signdate: detailData.signdate, |
| | | relativeconfirmationsignname: |
| | | detailData.relativeconfirmationsignname || "", |
| | | familyrelations: detailData.familyrelations || "", |
| | | signfamilyrelations: detailData.signfamilyrelations || "", |
| | | relativeidcardno: detailData.relativeidcardno || "", |
| | | relativephone: detailData.relativephone || "", |
| | | relativeRemark: detailData.relativeRemark || "", |
| | |
| | | ? detailData.organdecision |
| | | : detailData.organdecision.split(","); |
| | | } |
| | | console.log(this.organdecision,'this.organdecision'); |
| | | |
| | | |
| | | // å¤çéä»¶æ°æ® - ä»assessannexåæ®µè§£æJSONå¹¶æç±»ååç±» |
| | | this.processAssessannexData(); |
| | |
| | | |
| | | /** ä¸ä¼ æåå¤ç */ |
| | | handleUploadSuccess({ file, fileList, response }) { |
| | | console.log(response,'response'); |
| | | |
| | | if (response.code === 200) { |
| | | console.log(response, "ä¸ä¼ æ°æ®"); |
| | | |
| | |
| | | <span class="attachment-title">éä»¶ä¸ä¼ </span> |
| | | <span class="attachment-tip">æ¯æä¸ä¼ æ£éªæ¥ååçæä»¶ (æå¤10个)</span> |
| | | </div> |
| | | <upload-attachment |
| | | :file-list="attachments" |
| | | |
| | | <!-- ä½¿ç¨ UploadAttachment ç»ä»¶ --> |
| | | <UploadAttachment |
| | | ref="uploadAttachment" |
| | | :file-list="attachmentFileList" |
| | | :limit="attachmentLimit" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleAttachmentChange" |
| | | :limit="10" |
| | | :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'" |
| | | @upload-success="handleUploadSuccess" |
| | | @upload-error="handleUploadError" |
| | | @remove="handleAttachmentRemove" |
| | | /> |
| | | |
| | | <!-- éä»¶å表å±ç¤º --> |
| | | <div class="attachment-list" v-if="attachments && attachments.length > 0"> |
| | | <div class="list-title">å·²ä¸ä¼ éä»¶ ({{ attachments.length }})</div> |
| | | <el-table :data="attachments" style="width: 100%" size="small"> |
| | | <el-table-column label="æä»¶å" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | :style="{ color: getFileIconColor(scope.row.fileName) }" |
| | | ></i> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶ç±»å" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getFileTagType(scope.row.fileName)" size="small"> |
| | | {{ getFileTypeText(scope.row.fileName) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶å¤§å°" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="266" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreview(scope.row)" |
| | | :disabled="!isPreviewable(scope.row.fileName)" |
| | | > |
| | | é¢è§ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="success" |
| | | @click="handleDownload(scope.row)" |
| | | > |
| | | ä¸è½½ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="danger" |
| | | @click="handleRemoveAttachment(scope.$index)" |
| | | > |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- åç¼è¾å¯¹è¯æ¡ --> |
| | |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- æä»¶é¢è§å¼¹çª --> |
| | | <FilePreviewDialog |
| | | :visible="previewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="previewVisible = false" |
| | | @download="handleDownload" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "BloodRoutinePanel", |
| | | components: { |
| | | UploadAttachment |
| | | UploadAttachment, |
| | | FilePreviewDialog |
| | | }, |
| | | props: { |
| | | isEditing: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | // ä¿®æ¹ä¸º Object ç±»åï¼æ¯æå¤ææ°æ®ç»æ |
| | | initialData: { |
| | | type: Object, |
| | | default: () => ({}) |
| | |
| | | tableKey: 0, |
| | | tableLoading: false, |
| | | saveLoading: false, |
| | | // å
鍿°æ®ç¶æ |
| | | internalData: {}, |
| | | columnRules: { |
| | | date: [{ required: true, message: "è¯·éæ©æ¥æ", trigger: "change" }], |
| | | time: [{ required: true, message: "è¯·éæ©æ¶é´", trigger: "change" }] |
| | | } |
| | | }, |
| | | |
| | | // é¢è§ç¸å
³ |
| | | previewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // éä»¶ç¸å
³é
ç½® |
| | | attachmentLimit: 10, |
| | | attachmentAccept: |
| | | ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | attachmentFileList: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ initialData ååï¼ç¡®ä¿æ°æ®æ£ç¡®æ¥æ¶ |
| | | initialData: { |
| | | handler(newData) { |
| | | if (newData && Object.keys(newData).length > 0) { |
| | |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | // çå¬éä»¶æ°æ®åå |
| | | attachments: { |
| | | handler(newAttachments) { |
| | | this.attachmentFileList = newAttachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | })); |
| | | this.dynamicColumns = [...this.internalData.columns]; |
| | | } else { |
| | | // å¦ææ²¡æå¤é¨æ°æ®ï¼ä½¿ç¨ç»ä»¶é»è®¤åå§å |
| | | this.initTableData(); |
| | | } |
| | | |
| | |
| | | initTableData() { |
| | | const medicalItems = this.getMedicalItems(); |
| | | |
| | | // å¦ææ²¡æå¨æåï¼åå§åé»è®¤å |
| | | if (this.dynamicColumns.length === 0) { |
| | | this.dynamicColumns = [ |
| | | { |
| | |
| | | columns: this.dynamicColumns, |
| | | attachments: this.attachments |
| | | }; |
| | | |
| | | this.$emit("data-change", dataToEmit); |
| | | }, |
| | | |
| | |
| | | this.saveLoading = true; |
| | | |
| | | if (this.editingColumnIndex !== null) { |
| | | // ç¼è¾ç°æå |
| | | const column = this.dynamicColumns[this.editingColumnIndex]; |
| | | column.label = `${this.columnForm.date}\n${this.columnForm.time}`; |
| | | column.date = this.columnForm.date; |
| | |
| | | column.remark = this.columnForm.remark; |
| | | this.$message.success("æ¶é´ç¹ä¿®æ¹æå"); |
| | | } else { |
| | | // æ°å¢å |
| | | const newColumn = { |
| | | label: `${this.columnForm.date}\n${this.columnForm.time}`, |
| | | key: `time${Date.now()}`, |
| | |
| | | time: this.columnForm.time, |
| | | remark: this.columnForm.remark |
| | | }; |
| | | |
| | | this.internalData.columns.push(newColumn); |
| | | |
| | | this.dynamicColumns.push(newColumn); |
| | | this.tableData.forEach(row => { |
| | | if (!row.values) row.values = []; |
| | |
| | | this.columnDialogVisible = false; |
| | | this.saveLoading = false; |
| | | this.tableKey += 1; |
| | | this.saveData(); |
| | | }); |
| | | }, |
| | | |
| | |
| | | }); |
| | | this.columnDialogVisible = false; |
| | | this.tableKey += 1; |
| | | this.saveData(); |
| | | this.$message.success("æ¶é´ç¹å 餿å"); |
| | | }); |
| | | } |
| | |
| | | this.saveData(); |
| | | }, |
| | | |
| | | /** éä»¶ååå¤ç */ |
| | | handleAttachmentChange(fileList) { |
| | | this.attachments = fileList; |
| | | this.$emit("attachment-change", { |
| | | type: "blood_routine", |
| | | attachments: fileList |
| | | }); |
| | | this.attachmentFileList = fileList; |
| | | }, |
| | | |
| | | /** éä»¶ç§»é¤å¤ç */ |
| | | handleAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.attachments.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ æåå¤ç */ |
| | | handleUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.attachments)) { |
| | | this.attachments = []; |
| | | } |
| | | |
| | | this.attachments.push(attachmentObj); |
| | | this.attachmentFileList = fileList; |
| | | this.saveData(); |
| | | this.$message.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ é误å¤ç */ |
| | | handleUploadError({ file, fileList, error }) { |
| | | console.error("éä»¶ä¸ä¼ 失败:", error); |
| | | this.$message.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | }, |
| | | |
| | | /** æå¨å é¤éä»¶ */ |
| | | handleRemoveAttachment(index) { |
| | | this.attachments.splice(index, 1); |
| | | this.attachmentFileList.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | }, |
| | | |
| | | /** æä»¶é¢è§ */ |
| | | handlePreview(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.path || file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | /** æä»¶ä¸è½½ */ |
| | | handleDownload(file) { |
| | | const fileUrl = file.path || file.fileUrl; |
| | | const fileName = file.fileName; |
| | | |
| | | if (fileUrl) { |
| | | const link = document.createElement("a"); |
| | | link.href = fileUrl; |
| | | link.download = fileName; |
| | | link.style.display = "none"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | this.$message.success("å¼å§ä¸è½½æä»¶"); |
| | | } else { |
| | | this.$message.warning("æä»¶è·¯å¾ä¸åå¨ï¼æ æ³ä¸è½½"); |
| | | } |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»å */ |
| | | getFileType(fileName) { |
| | | if (!fileName) return "other"; |
| | | const extension = fileName |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | /** è·åæä»¶å¾æ é¢è² */ |
| | | getFileIconColor(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const colorMap = { |
| | | image: "#67C23A", |
| | | pdf: "#F56C6C", |
| | | office: "#409EFF", |
| | | other: "#909399" |
| | | }; |
| | | return colorMap[type] || "#909399"; |
| | | }, |
| | | |
| | | /** è·åæä»¶æ ç¾ç±»å */ |
| | | getFileTagType(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const typeMap = { |
| | | image: "success", |
| | | pdf: "danger", |
| | | office: "primary", |
| | | other: "info" |
| | | }; |
| | | return typeMap[type] || "info"; |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»åææ¬ */ |
| | | getFileTypeText(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const textMap = { |
| | | image: "å¾ç", |
| | | pdf: "PDF", |
| | | office: "ææ¡£", |
| | | other: "å
¶ä»" |
| | | }; |
| | | return textMap[type] || "æªç¥"; |
| | | }, |
| | | |
| | | /** æ£æ¥æ¯å¦å¯é¢è§ */ |
| | | isPreviewable(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | return ["image", "pdf"].includes(type); |
| | | }, |
| | | |
| | | /** è·åæä»¶æ©å±å */ |
| | | getFileExtension(filename) { |
| | | return filename |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | }, |
| | | |
| | | /** æ ¼å¼åæä»¶å¤§å° */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | /** æ¥ææ¶é´æ ¼å¼å */ |
| | | formatDateTime(dateTime) { |
| | | if (!dateTime) return ""; |
| | | try { |
| | | const date = new Date(dateTime); |
| | | if (isNaN(date.getTime())) return dateTime; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}`; |
| | | } catch (error) { |
| | | return dateTime; |
| | | } |
| | | }, |
| | | |
| | | forceTableLayout() { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // ç¡®ä¿ç»ä»¶æ£ç¡®æè½½ååå§åæ°æ® |
| | | this.$nextTick(() => { |
| | | if (Object.keys(this.internalData).length === 0) { |
| | | this.initTableData(); |
| | |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* éä»¶ä¸ä¼ åºåæ ·å¼ä¼å */ |
| | | .attachment-section { |
| | | margin-top: 24px; |
| | | padding: 20px; |
| | |
| | | color: #909399; |
| | | } |
| | | |
| | | .attachment-list { |
| | | margin-top: 16px; |
| | | } |
| | | |
| | | .list-title { |
| | | font-weight: bold; |
| | | margin-bottom: 12px; |
| | | color: #303133; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | /* ååºå¼è®¾è®¡ */ |
| | | @media (max-width: 768px) { |
| | | .medical-panel { |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- éä»¶ä¸ä¼ åºå --> |
| | | <!-- éä»¶ä¸ä¼ åºåä¼å --> |
| | | <div class="attachment-section"> |
| | | <div class="attachment-title"> |
| | | <div class="attachment-header"> |
| | | <i class="el-icon-paperclip"></i> |
| | | éä»¶ä¸ä¼ |
| | | <span class="attachment-tip">æ¯æä¸ä¼ æ£éªæ¥ååçæä»¶</span> |
| | | <span class="attachment-title">éä»¶ä¸ä¼ </span> |
| | | <span class="attachment-tip" |
| | | >æ¯æä¸ä¼ æ£éªæ¥ååçæä»¶ (æå¤{{ attachmentLimit }}个)</span |
| | | > |
| | | </div> |
| | | <upload-attachment |
| | | :file-list="attachments" |
| | | |
| | | <!-- ä½¿ç¨ UploadAttachment ç»ä»¶ --> |
| | | <UploadAttachment |
| | | ref="uploadAttachment" |
| | | :file-list="attachmentFileList" |
| | | :limit="attachmentLimit" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleAttachmentChange" |
| | | :limit="10" |
| | | :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'" |
| | | @upload-success="handleUploadSuccess" |
| | | @upload-error="handleUploadError" |
| | | @remove="handleAttachmentRemove" |
| | | /> |
| | | |
| | | <!-- éä»¶å表å±ç¤º --> |
| | | <div class="attachment-list" v-if="attachments && attachments.length > 0"> |
| | | <div class="list-title">å·²ä¸ä¼ éä»¶ ({{ attachments.length }})</div> |
| | | <el-table :data="attachments" style="width: 100%" size="small"> |
| | | <el-table-column label="æä»¶å" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | :style="{ color: getFileIconColor(scope.row.fileName) }" |
| | | ></i> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶ç±»å" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getFileTagType(scope.row.fileName)" size="small"> |
| | | {{ getFileTypeText(scope.row.fileName) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶å¤§å°" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="266" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreview(scope.row)" |
| | | :disabled="!isPreviewable(scope.row.fileName)" |
| | | > |
| | | é¢è§ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="success" |
| | | @click="handleDownload(scope.row)" |
| | | > |
| | | ä¸è½½ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="danger" |
| | | @click="handleRemoveAttachment(scope.$index)" |
| | | > |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- åç¼è¾å¯¹è¯æ¡ --> |
| | |
| | | <el-button type="primary" @click="confirmAddColumn">ç¡®å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- æä»¶é¢è§å¼¹çª --> |
| | | <FilePreviewDialog |
| | | :visible="previewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="previewVisible = false" |
| | | @download="handleDownload" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "LiverKidneyPanel", |
| | | components: { |
| | | UploadAttachment |
| | | UploadAttachment, |
| | | FilePreviewDialog |
| | | }, |
| | | props: { |
| | | isEditing: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | // ä¿®æ¹ prop å®ä¹ï¼æ¯æå¯¹è±¡æ ¼å¼çåå§æ°æ® |
| | | initialData: { |
| | | type: Object, |
| | | default: () => ({}) |
| | |
| | | time: "" |
| | | }, |
| | | tableKey: 0, |
| | | // å
鍿°æ®ç¶æ |
| | | internalData: {} |
| | | internalData: {}, |
| | | |
| | | // é¢è§ç¸å
³ |
| | | previewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // éä»¶ç¸å
³é
ç½® |
| | | attachmentLimit: 10, |
| | | attachmentAccept: |
| | | ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | attachmentFileList: [] |
| | | }; |
| | | }, |
| | | watch: { |
| | | // çå¬ initialData ååï¼ç¡®ä¿æ°æ®æ£ç¡®æ¥æ¶ [5](@ref) |
| | | initialData: { |
| | | handler(newData) { |
| | | if (newData && Object.keys(newData).length > 0) { |
| | |
| | | }); |
| | | }, |
| | | deep: true |
| | | }, |
| | | // çå¬éä»¶æ°æ®åå |
| | | attachments: { |
| | | handler(newAttachments) { |
| | | this.attachmentFileList = newAttachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | // ä»å¤é¨æ°æ®åå§åç»ä»¶ [9](@ref) |
| | | // ä»å¤é¨æ°æ®åå§åç»ä»¶ |
| | | initFromExternalData() { |
| | | if (this.internalData.data && this.internalData.columns) { |
| | | // 使ç¨å¤é¨æ°æ®åå§åè¡¨æ ¼ |
| | | this.tableData = this.internalData.data.map(item => ({ |
| | | ...item, |
| | | values: |
| | |
| | | })); |
| | | this.dynamicColumns = [...this.internalData.columns]; |
| | | } else { |
| | | // å¦ææ²¡æå¤é¨æ°æ®ï¼ä½¿ç¨é»è®¤åå§å |
| | | this.initTableData(); |
| | | } |
| | | |
| | |
| | | { itemName: "INR", unit: "", required: true, reference: "0.85-1.15" } |
| | | ]; |
| | | |
| | | // å¦ææ²¡æå¨æåï¼åå§åé»è®¤å |
| | | if (this.dynamicColumns.length === 0) { |
| | | this.dynamicColumns = [ |
| | | { |
| | |
| | | })); |
| | | }, |
| | | |
| | | // ä¿åæ°æ®å°ç¶ç»ä»¶ [2](@ref) |
| | | // ä¿åæ°æ®å°ç¶ç»ä»¶ |
| | | saveData() { |
| | | const dataToEmit = { |
| | | type: "liver_kidney", |
| | |
| | | date: this.columnForm.date, |
| | | time: this.columnForm.time |
| | | }; |
| | | this.internalData.columns.push(newColumn); |
| | | |
| | | this.dynamicColumns.push(newColumn); |
| | | |
| | |
| | | this.columnDialogVisible = false; |
| | | this.$message.success("æ¶é´ç¹æ·»å æå"); |
| | | this.tableKey += 1; |
| | | this.saveData(); |
| | | }); |
| | | }, |
| | | |
| | | handleDialogClosed() { |
| | | this.columnForm = { |
| | | date: "", |
| | | time: "" |
| | | }; |
| | | this.columnForm = { date: "", time: "" }; |
| | | this.$refs.columnForm && this.$refs.columnForm.clearValidate(); |
| | | }, |
| | | |
| | |
| | | this.saveData(); |
| | | }, |
| | | |
| | | /** éä»¶ååå¤ç */ |
| | | handleAttachmentChange(fileList) { |
| | | this.attachments = fileList; |
| | | this.$emit("attachment-change", { |
| | | type: "liver_kidney", |
| | | attachments: fileList |
| | | }); |
| | | this.attachmentFileList = fileList; |
| | | }, |
| | | |
| | | /** éä»¶ç§»é¤å¤ç */ |
| | | handleAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.attachments.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ æåå¤ç */ |
| | | handleUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | // ç¡®ä¿ attachments æ¯æ°ç» |
| | | if (!Array.isArray(this.attachments)) { |
| | | this.attachments = []; |
| | | } |
| | | |
| | | this.attachments.push(attachmentObj); |
| | | this.attachmentFileList = fileList; |
| | | this.saveData(); |
| | | this.$message.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ é误å¤ç */ |
| | | handleUploadError({ file, fileList, error }) { |
| | | console.error("éä»¶ä¸ä¼ 失败:", error); |
| | | this.$message.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | }, |
| | | |
| | | /** æå¨å é¤éä»¶ */ |
| | | handleRemoveAttachment(index) { |
| | | this.attachments.splice(index, 1); |
| | | this.attachmentFileList.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | }, |
| | | |
| | | /** æä»¶é¢è§ */ |
| | | handlePreview(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.path || file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | /** æä»¶ä¸è½½ */ |
| | | handleDownload(file) { |
| | | const fileUrl = file.path || file.fileUrl; |
| | | const fileName = file.fileName; |
| | | |
| | | if (fileUrl) { |
| | | const link = document.createElement("a"); |
| | | link.href = fileUrl; |
| | | link.download = fileName; |
| | | link.style.display = "none"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | this.$message.success("å¼å§ä¸è½½æä»¶"); |
| | | } else { |
| | | this.$message.warning("æä»¶è·¯å¾ä¸åå¨ï¼æ æ³ä¸è½½"); |
| | | } |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»å */ |
| | | getFileType(fileName) { |
| | | if (!fileName) return "other"; |
| | | const extension = fileName |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | /** è·åæä»¶å¾æ é¢è² */ |
| | | getFileIconColor(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const colorMap = { |
| | | image: "#67C23A", |
| | | pdf: "#F56C6C", |
| | | office: "#409EFF", |
| | | other: "#909399" |
| | | }; |
| | | return colorMap[type] || "#909399"; |
| | | }, |
| | | |
| | | /** è·åæä»¶æ ç¾ç±»å */ |
| | | getFileTagType(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const typeMap = { |
| | | image: "success", |
| | | pdf: "danger", |
| | | office: "primary", |
| | | other: "info" |
| | | }; |
| | | return typeMap[type] || "info"; |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»åææ¬ */ |
| | | getFileTypeText(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const textMap = { |
| | | image: "å¾ç", |
| | | pdf: "PDF", |
| | | office: "ææ¡£", |
| | | other: "å
¶ä»" |
| | | }; |
| | | return textMap[type] || "æªç¥"; |
| | | }, |
| | | |
| | | /** æ£æ¥æ¯å¦å¯é¢è§ */ |
| | | isPreviewable(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | return ["image", "pdf"].includes(type); |
| | | }, |
| | | |
| | | /** è·åæä»¶æ©å±å */ |
| | | getFileExtension(filename) { |
| | | return filename |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | }, |
| | | |
| | | /** æ ¼å¼åæä»¶å¤§å° */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | /** æ¥ææ¶é´æ ¼å¼å */ |
| | | formatDateTime(dateTime) { |
| | | if (!dateTime) return ""; |
| | | try { |
| | | const date = new Date(dateTime); |
| | | if (isNaN(date.getTime())) return dateTime; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}`; |
| | | } catch (error) { |
| | | return dateTime; |
| | | } |
| | | }, |
| | | |
| | | forceTableLayout() { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // ç¡®ä¿ç»ä»¶æ£ç¡®æè½½ååå§åæ°æ® [1](@ref) |
| | | this.$nextTick(() => { |
| | | if (Object.keys(this.internalData).length === 0) { |
| | | this.initTableData(); |
| | |
| | | margin-right: 4px; |
| | | } |
| | | |
| | | /* éä»¶ä¸ä¼ åºåæ ·å¼ä¼å */ |
| | | .attachment-section { |
| | | margin-top: 30px; |
| | | padding: 20px; |
| | |
| | | background: #fafafa; |
| | | } |
| | | |
| | | .attachment-title { |
| | | font-weight: bold; |
| | | margin-bottom: 15px; |
| | | color: #409eff; |
| | | .attachment-header { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 16px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .attachment-title { |
| | | font-weight: bold; |
| | | margin: 0 8px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .attachment-tip { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | margin-left: 10px; |
| | | font-weight: normal; |
| | | margin-left: auto; |
| | | } |
| | | |
| | | .attachment-list { |
| | | margin-top: 16px; |
| | | } |
| | | |
| | | .list-title { |
| | | font-weight: bold; |
| | | margin-bottom: 12px; |
| | | color: #303133; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | /* ååºå¼è°æ´ */ |
| | | @media (max-width: 768px) { |
| | | .medical-panel { |
| | | padding: 10px; |
| | |
| | | margin-left: 0; |
| | | margin-top: 4px; |
| | | } |
| | | |
| | | .attachment-section { |
| | | padding: 10px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | >æ¯æä¸ä¼ å°¿å¸¸è§æ£éªæ¥ååçæä»¶ (æå¤10个)</span |
| | | > |
| | | </div> |
| | | <upload-attachment |
| | | :file-list="attachments" |
| | | |
| | | <!-- ä½¿ç¨ UploadAttachment ç»ä»¶ --> |
| | | <UploadAttachment |
| | | ref="uploadAttachment" |
| | | :file-list="attachmentFileList" |
| | | :limit="attachmentLimit" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleAttachmentChange" |
| | | :limit="10" |
| | | :accept="'.pdf,.jpg,.jpeg,.png,.doc,.docx'" |
| | | @upload-success="handleUploadSuccess" |
| | | @upload-error="handleUploadError" |
| | | @remove="handleAttachmentRemove" |
| | | /> |
| | | |
| | | <!-- éä»¶å表å±ç¤º --> |
| | | <div class="attachment-list" v-if="attachments && attachments.length > 0"> |
| | | <div class="list-title">å·²ä¸ä¼ éä»¶ ({{ attachments.length }})</div> |
| | | <el-table :data="attachments" style="width: 100%" size="small"> |
| | | <el-table-column label="æä»¶å" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | :style="{ color: getFileIconColor(scope.row.fileName) }" |
| | | ></i> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶ç±»å" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getFileTagType(scope.row.fileName)" size="small"> |
| | | {{ getFileTypeText(scope.row.fileName) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶å¤§å°" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="266" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreview(scope.row)" |
| | | :disabled="!isPreviewable(scope.row.fileName)" |
| | | > |
| | | é¢è§ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="success" |
| | | @click="handleDownload(scope.row)" |
| | | > |
| | | ä¸è½½ |
| | | </el-button> |
| | | <el-button |
| | | v-if="isEditing" |
| | | size="mini" |
| | | type="danger" |
| | | @click="handleRemoveAttachment(scope.$index)" |
| | | > |
| | | å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- åç¼è¾å¯¹è¯æ¡ --> |
| | |
| | | </el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- æä»¶é¢è§å¼¹çª --> |
| | | <FilePreviewDialog |
| | | :visible="previewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="previewVisible = false" |
| | | @download="handleDownload" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "UrineRoutinePanel", |
| | | components: { |
| | | UploadAttachment |
| | | UploadAttachment, |
| | | FilePreviewDialog |
| | | }, |
| | | props: { |
| | | isEditing: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | // ä¿®æ¹ä¸º Object ç±»åï¼æ¯æå¤ææ°æ®ç»æ |
| | | initialData: { |
| | | type: Object, |
| | | default: () => ({}) |
| | |
| | | tableKey: 0, |
| | | tableLoading: false, |
| | | saveLoading: false, |
| | | // å
鍿°æ®ç¶æ |
| | | internalData: {}, |
| | | columnRules: { |
| | | date: [{ required: true, message: "è¯·éæ©æ¥æ", trigger: "change" }], |
| | | time: [{ required: true, message: "è¯·éæ©æ¶é´", trigger: "change" }] |
| | | } |
| | | }, |
| | | |
| | | // é¢è§ç¸å
³ |
| | | previewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // éä»¶ç¸å
³é
ç½® |
| | | attachmentLimit: 10, |
| | | attachmentAccept: |
| | | ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | attachmentFileList: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | // çå¬ initialData ååï¼ç¡®ä¿æ°æ®æ£ç¡®æ¥æ¶ |
| | | initialData: { |
| | | handler(newData) { |
| | | console.log(newData); |
| | | |
| | | if (newData && Object.keys(newData).length > 0) { |
| | | this.internalData = { ...newData }; |
| | | this.initFromExternalData(); |
| | |
| | | }, |
| | | deep: true, |
| | | immediate: true |
| | | }, |
| | | // çå¬éä»¶æ°æ®åå |
| | | attachments: { |
| | | handler(newAttachments) { |
| | | this.attachmentFileList = newAttachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })); |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | methods: { |
| | | // ä»å¤é¨æ°æ®åå§åç»ä»¶ |
| | | initFromExternalData() { |
| | | console.log(this.internalData,'this.internalData'); |
| | | console.log(this.internalData, "this.internalData"); |
| | | |
| | | if (this.internalData.data && this.internalData.columns) { |
| | | this.tableData = this.internalData.data.map(item => ({ |
| | |
| | | })); |
| | | this.dynamicColumns = [...this.internalData.columns]; |
| | | } else { |
| | | // å¦ææ²¡æå¤é¨æ°æ®ï¼ä½¿ç¨ç»ä»¶é»è®¤åå§å |
| | | this.initTableData(); |
| | | } |
| | | |
| | |
| | | initTableData() { |
| | | const medicalItems = this.getMedicalItems(); |
| | | |
| | | // å¦ææ²¡æå¨æåï¼åå§åé»è®¤å |
| | | if (this.dynamicColumns.length === 0) { |
| | | this.dynamicColumns = [ |
| | | { |
| | |
| | | this.saveLoading = true; |
| | | |
| | | if (this.editingColumnIndex !== null) { |
| | | // ç¼è¾ç°æå |
| | | const column = this.dynamicColumns[this.editingColumnIndex]; |
| | | column.label = `${this.columnForm.date}\n${this.columnForm.time}`; |
| | | column.date = this.columnForm.date; |
| | |
| | | column.remark = this.columnForm.remark; |
| | | this.$message.success("æ¶é´ç¹ä¿®æ¹æå"); |
| | | } else { |
| | | // æ°å¢å |
| | | const newColumn = { |
| | | label: `${this.columnForm.date}\n${this.columnForm.time}`, |
| | | key: `time${Date.now()}`, |
| | |
| | | this.columnDialogVisible = false; |
| | | this.saveLoading = false; |
| | | this.tableKey += 1; |
| | | this.saveData(); |
| | | }); |
| | | }, |
| | | |
| | |
| | | }); |
| | | this.columnDialogVisible = false; |
| | | this.tableKey += 1; |
| | | this.saveData(); |
| | | this.$message.success("æ¶é´ç¹å 餿å"); |
| | | }); |
| | | } |
| | |
| | | this.saveData(); |
| | | }, |
| | | |
| | | /** éä»¶ååå¤ç */ |
| | | handleAttachmentChange(fileList) { |
| | | this.attachments = fileList; |
| | | this.$emit("attachment-change", { |
| | | type: "urine_routine", |
| | | attachments: fileList |
| | | }); |
| | | this.attachmentFileList = fileList; |
| | | }, |
| | | |
| | | /** éä»¶ç§»é¤å¤ç */ |
| | | handleAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.attachments.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ æåå¤ç */ |
| | | handleUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.attachments)) { |
| | | this.attachments = []; |
| | | } |
| | | |
| | | this.attachments.push(attachmentObj); |
| | | this.attachmentFileList = fileList; |
| | | this.saveData(); |
| | | this.$message.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | }, |
| | | |
| | | /** ä¸ä¼ é误å¤ç */ |
| | | handleUploadError({ file, fileList, error }) { |
| | | console.error("éä»¶ä¸ä¼ 失败:", error); |
| | | this.$message.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | }, |
| | | |
| | | /** æå¨å é¤éä»¶ */ |
| | | handleRemoveAttachment(index) { |
| | | this.attachments.splice(index, 1); |
| | | this.attachmentFileList.splice(index, 1); |
| | | this.saveData(); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | }, |
| | | |
| | | /** æä»¶é¢è§ */ |
| | | handlePreview(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.path || file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.previewVisible = true; |
| | | }, |
| | | |
| | | /** æä»¶ä¸è½½ */ |
| | | handleDownload(file) { |
| | | const fileUrl = file.path || file.fileUrl; |
| | | const fileName = file.fileName; |
| | | |
| | | if (fileUrl) { |
| | | const link = document.createElement("a"); |
| | | link.href = fileUrl; |
| | | link.download = fileName; |
| | | link.style.display = "none"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | this.$message.success("å¼å§ä¸è½½æä»¶"); |
| | | } else { |
| | | this.$message.warning("æä»¶è·¯å¾ä¸åå¨ï¼æ æ³ä¸è½½"); |
| | | } |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»å */ |
| | | getFileType(fileName) { |
| | | if (!fileName) return "other"; |
| | | const extension = fileName |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | /** è·åæä»¶å¾æ é¢è² */ |
| | | getFileIconColor(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const colorMap = { |
| | | image: "#67C23A", |
| | | pdf: "#F56C6C", |
| | | office: "#409EFF", |
| | | other: "#909399" |
| | | }; |
| | | return colorMap[type] || "#909399"; |
| | | }, |
| | | |
| | | /** è·åæä»¶æ ç¾ç±»å */ |
| | | getFileTagType(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const typeMap = { |
| | | image: "success", |
| | | pdf: "danger", |
| | | office: "primary", |
| | | other: "info" |
| | | }; |
| | | return typeMap[type] || "info"; |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»åææ¬ */ |
| | | getFileTypeText(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const textMap = { |
| | | image: "å¾ç", |
| | | pdf: "PDF", |
| | | office: "ææ¡£", |
| | | other: "å
¶ä»" |
| | | }; |
| | | return textMap[type] || "æªç¥"; |
| | | }, |
| | | |
| | | /** æ£æ¥æ¯å¦å¯é¢è§ */ |
| | | isPreviewable(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | return ["image", "pdf"].includes(type); |
| | | }, |
| | | |
| | | /** è·åæä»¶æ©å±å */ |
| | | getFileExtension(filename) { |
| | | return filename |
| | | .split(".") |
| | | .pop() |
| | | .toLowerCase(); |
| | | }, |
| | | |
| | | /** æ ¼å¼åæä»¶å¤§å° */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | /** æ¥ææ¶é´æ ¼å¼å */ |
| | | formatDateTime(dateTime) { |
| | | if (!dateTime) return ""; |
| | | try { |
| | | const date = new Date(dateTime); |
| | | if (isNaN(date.getTime())) return dateTime; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}`; |
| | | } catch (error) { |
| | | return dateTime; |
| | | } |
| | | }, |
| | | |
| | | forceTableLayout() { |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | // ç¡®ä¿ç»ä»¶æ£ç¡®æè½½ååå§åæ°æ® |
| | | this.$nextTick(() => { |
| | | if (Object.keys(this.internalData).length === 0) { |
| | | this.initTableData(); |
| | |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* éä»¶ä¸ä¼ åºåæ ·å¼ä¼å */ |
| | | .attachment-section { |
| | | margin-top: 24px; |
| | | padding: 20px; |
| | |
| | | color: #909399; |
| | | } |
| | | |
| | | .attachment-list { |
| | | margin-top: 16px; |
| | | } |
| | | |
| | | .list-title { |
| | | font-weight: bold; |
| | | margin-bottom: 12px; |
| | | color: #303133; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | /* ååºå¼è®¾è®¡ */ |
| | | @media (max-width: 768px) { |
| | | .medical-panel { |
| | |
| | | <el-col :span="8"> |
| | | <el-form-item label="æ£è
ç¶æ" prop="recordstate"> |
| | | <el-select v-model="form.recordstate" style="width: 100%"> |
| | | <!-- <el-option label="DCD" value="1" /> |
| | | <el-option label="DBD" value="2" /> |
| | | <el-option label="DBCD" value="3" /> |
| | | <el-option label="已宿æç®" value="4" /> |
| | | <el-option label="æªå®ææç®" value="5" /> --> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item |
| | | align="left" |
| | | label="æ£è
æç®ç¶æ" |
| | | prop="donationcategory" |
| | | > |
| | | <el-radio-group v-model="form.recordstate"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> --> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item |
| | |
| | | <el-col :span="8"> |
| | | <el-form-item label="è¡å" prop="bloodtype"> |
| | | <el-select v-model="form.bloodtype" style="width: 100%"> |
| | | <!-- <el-option label="Aå" value="A" /> |
| | | <el-option label="Bå" value="B" /> |
| | | <el-option label="Oå" value="O" /> |
| | | <el-option label="ABå" value="AB" /> --> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_BloodType" |
| | | :key="dict.value" |
| | |
| | | </el-row> |
| | | |
| | | <el-form-item label="éä»¶"> |
| | | <upload-attachment |
| | | :file-list="cultureForm.attachments" |
| | | <UploadAttachment |
| | | ref="cultureUploadAttachment" |
| | | :file-list="cultureFileList" |
| | | :limit="10" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleCultureAttachmentChange" |
| | | @upload-success="handleCultureUploadSuccess" |
| | | @upload-error="handleCultureUploadError" |
| | | @remove="handleCultureAttachmentRemove" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="éä»¶"> |
| | | <upload-attachment |
| | | :file-list="recordForm.attachments" |
| | | <UploadAttachment |
| | | ref="recordUploadAttachment" |
| | | :file-list="recordFileList" |
| | | :limit="10" |
| | | :accept="attachmentAccept" |
| | | :multiple="true" |
| | | @change="handleRecordAttachmentChange" |
| | | @upload-success="handleRecordUploadSuccess" |
| | | @upload-error="handleRecordUploadError" |
| | | @remove="handleRecordAttachmentRemove" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- éä»¶é¢è§å¯¹è¯æ¡ --> |
| | | <attachment-preview |
| | | :visible="attachmentPreviewVisible" |
| | | :file-list="currentAttachmentList" |
| | | <el-dialog |
| | | :title="attachmentPreviewTitle" |
| | | @close="attachmentPreviewVisible = false" |
| | | :visible.sync="attachmentPreviewVisible" |
| | | width="900px" |
| | | @close="handleAttachmentPreviewClose" |
| | | > |
| | | <el-table :data="currentAttachmentList" style="width: 100%" size="small"> |
| | | <el-table-column label="æä»¶å" min-width="200"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | | class="el-icon-document" |
| | | :style="{ color: getFileIconColor(scope.row.fileName) }" |
| | | ></i> |
| | | <span class="file-name">{{ scope.row.fileName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶ç±»å" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag :type="getFileTagType(scope.row.fileName)" size="small"> |
| | | {{ getFileTypeText(scope.row.fileName) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸ä¼ æ¶é´" width="160"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatDateTime(scope.row.uploadTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä»¶å¤§å°" width="100"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ formatFileSize(scope.row.fileSize) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" width="150" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="primary" |
| | | @click="handlePreviewAttachment(scope.row)" |
| | | :disabled="!isPreviewable(scope.row.fileName)" |
| | | > |
| | | é¢è§ |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="success" |
| | | @click="handleDownloadAttachment(scope.row)" |
| | | > |
| | | ä¸è½½ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | |
| | | <!-- æä»¶é¢è§å¼¹çª --> |
| | | <FilePreviewDialog |
| | | :visible="filePreviewVisible" |
| | | :file="currentPreviewFile" |
| | | @close="filePreviewVisible = false" |
| | | @download="handleDownloadAttachment" |
| | | /> |
| | | </div> |
| | | </template> |
| | |
| | | import { maintainList, maintainedit, maintainAdd } from "@/api/businessApi"; |
| | | import Pagination from "@/components/Pagination"; |
| | | import UploadAttachment from "@/components/UploadAttachment"; |
| | | import AttachmentPreview from "@/components/AttachmentPreview"; |
| | | import FilePreviewDialog from "@/components/FilePreviewDialog"; |
| | | import LiverKidneyPanel from "./components/LiverKidneyPanel.vue"; |
| | | import BloodRoutinePanel from "./components/BloodRoutinePanel.vue"; |
| | | import UrineRoutinePanel from "./components/UrineRoutinePanel.vue"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | export default { |
| | | name: "MaintenanceDetail", |
| | | components: { |
| | | Pagination, |
| | | UploadAttachment, |
| | | AttachmentPreview, |
| | | FilePreviewDialog, |
| | | LiverKidneyPanel, |
| | | BloodRoutinePanel, |
| | | UrineRoutinePanel |
| | |
| | | incompleteReason: "" |
| | | }, |
| | | activeTab: "culture", |
| | | liverKidneyData: {}, // ä» maintainList æ¥å£è·åçæ°æ® |
| | | bloodRoutineData: {}, // ä» maintainList æ¥å£è·åçæ°æ® |
| | | liverKidneyData: {}, // ä» maintainList æ¥å£è·åçæ°æ® |
| | | extracontentinfo: {}, |
| | | |
| | | // å¹å
»ç»æç¸å
³æ°æ® |
| | | cultureList: [], |
| | | cultureLoading: false, |
| | |
| | | result: "é´æ§", |
| | | attachments: [] |
| | | }, |
| | | cultureFileList: [], |
| | | cultureRules: { |
| | | cultureType: [ |
| | | { required: true, message: "è¯·éæ©å¹å
»ç±»å", trigger: "change" } |
| | |
| | | checkRecord: "", |
| | | attachments: [] |
| | | }, |
| | | recordFileList: [], |
| | | recordRules: { |
| | | recordTime: [ |
| | | { required: true, message: "è¯·éæ©æ ¸æ¥æ¶é´", trigger: "change" } |
| | |
| | | attachmentPreviewVisible: false, |
| | | currentAttachmentList: [], |
| | | attachmentPreviewTitle: "", |
| | | |
| | | // æä»¶é¢è§ç¸å
³ |
| | | filePreviewVisible: false, |
| | | currentPreviewFile: null, |
| | | |
| | | // éä»¶ç¸å
³é
ç½® |
| | | attachmentLimit: 10, |
| | | attachmentAccept: ".pdf,.jpg,.jpeg,.png,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt", |
| | | |
| | | // è¯ä¼°æ°æ®åå¨ |
| | | assessmentData: { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | // å è½½ç»´æ¤æ°æ®[1,3](@ref) |
| | | // å è½½ç»´æ¤æ°æ® |
| | | async loadMaintenanceData() { |
| | | try { |
| | | this.cultureLoading = true; |
| | |
| | | const queryParams = {}; |
| | | |
| | | if (id) { |
| | | queryParams.id = id; |
| | | queryParams.infoid = infoid; |
| | | this.currentMaintenanceId = id; |
| | | this.isEditMode = true; |
| | | } else if (infoid) { |
| | |
| | | this.$message.error("缺å°å¿
è¦çè·¯ç±åæ°"); |
| | | return; |
| | | } |
| | | |
| | | queryParams.infoid = infoid; |
| | | const response = await maintainList(queryParams); |
| | | if (response.code === 200) { |
| | | let maintenanceData = response.data[0]; |
| | | |
| | | // å¤çæ°ç»ååº |
| | | if (Array.isArray(maintenanceData)) { |
| | | maintenanceData = maintenanceData[0] || {}; |
| | | } |
| | | if (maintenanceData.extracontent) { |
| | | this.extracontentinfo = JSON.parse(maintenanceData.extracontent); |
| | | if (this.extracontentinfo.specialMedicalHistory) { |
| | | this.form.specialMedicalHistory = |
| | | this.extracontentinfo.specialMedicalHistory; |
| | | this.form.specialMedicalHistory = this.extracontentinfo.specialMedicalHistory; |
| | | } |
| | | } |
| | | |
| | | // è§£æitemDescåæ®µä¸çJSONæ°æ®[6,8](@ref) |
| | | if (maintenanceData.itemDesc) { |
| | | try { |
| | | const itemDescData = maintenanceData.itemDesc; |
| | | this.assessmentData = { ...this.assessmentData, ...itemDescData }; |
| | | |
| | | // å¡«å
å个模åçæ°æ® |
| | | if (itemDescData.cultureResults) { |
| | | this.cultureList = itemDescData.cultureResults; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // å¡«å
åºç¡è¡¨åæ°æ® |
| | | this.form = { ...this.form, ...maintenanceData }; |
| | | this.$message.success("æ°æ®å è½½æå"); |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | |
| | | // ä¿åæææ°æ®[1,2](@ref) |
| | | // ä¿åæææ°æ® |
| | | async handleSave() { |
| | | try { |
| | | // æå»ºä¿åæ°æ® |
| | | const saveData = { |
| | | ...this.form, |
| | | itemDesc: { |
| | |
| | | this.extracontentinfo.specialMedicalHistory = this.form.specialMedicalHistory; |
| | | let response; |
| | | if (this.isEditMode && this.currentMaintenanceId) { |
| | | // ç¼è¾æ¨¡å¼ï¼è°ç¨maintaineditæ¥å£[1](@ref) |
| | | saveData.id = this.currentMaintenanceId; |
| | | response = await maintainedit(saveData); |
| | | } else { |
| | | // æ°å¢æ¨¡å¼ï¼è°ç¨maintainAddæ¥å£[2](@ref) |
| | | response = await maintainAdd(saveData); |
| | | } |
| | | |
| | |
| | | id: this.$route.query.infoid, |
| | | extracontent: JSON.stringify(this.extracontentinfo) |
| | | }); |
| | | // å¦ææ¯æ°å¢ä¿åï¼æ´æ°å½åID |
| | | if (!this.isEditMode && response.data && response.data.id) { |
| | | this.currentMaintenanceId = response.data.id; |
| | | this.isEditMode = true; |
| | |
| | | result: "é´æ§", |
| | | attachments: [] |
| | | }; |
| | | this.cultureFileList = []; |
| | | this.cultureDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.cultureForm && this.$refs.cultureForm.clearValidate(); |
| | |
| | | handleEditCulture(row) { |
| | | this.cultureDialogTitle = "ç¼è¾å¹å
»è®°å½"; |
| | | this.cultureForm = { ...row }; |
| | | this.cultureFileList = row.attachments ? row.attachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })) : []; |
| | | this.cultureDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.cultureForm && this.$refs.cultureForm.clearValidate(); |
| | |
| | | this.cultureSaveLoading = true; |
| | | |
| | | if (this.cultureForm.id) { |
| | | // ç¼è¾ç°æè®°å½ |
| | | const index = this.cultureList.findIndex( |
| | | item => item.id === this.cultureForm.id |
| | | ); |
| | |
| | | this.cultureList.splice(index, 1, { ...this.cultureForm }); |
| | | } |
| | | } else { |
| | | // æ°å¢è®°å½ |
| | | this.cultureForm.id = Date.now(); |
| | | this.cultureList.push({ ...this.cultureForm }); |
| | | } |
| | |
| | | checkRecord: "", |
| | | attachments: [] |
| | | }; |
| | | this.recordFileList = []; |
| | | this.recordDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.recordForm && this.$refs.recordForm.clearValidate(); |
| | |
| | | handleEditRecord(row) { |
| | | this.recordDialogTitle = "ç¼è¾æ¤çæ ¸æ¥è®°å½"; |
| | | this.recordForm = { ...row }; |
| | | this.recordFileList = row.attachments ? row.attachments.map(item => ({ |
| | | uid: item.id || Math.random(), |
| | | name: item.fileName, |
| | | fileSize: item.fileSize, |
| | | url: item.path || item.fileUrl, |
| | | uploadTime: item.uploadTime, |
| | | status: "success" |
| | | })) : []; |
| | | this.recordDialogVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.recordForm && this.$refs.recordForm.clearValidate(); |
| | |
| | | this.recordSaveLoading = true; |
| | | |
| | | if (this.recordForm.id) { |
| | | // ç¼è¾ç°æè®°å½ |
| | | const index = this.recordList.findIndex( |
| | | item => item.id === this.recordForm.id |
| | | ); |
| | |
| | | this.recordList.splice(index, 1, { ...this.recordForm }); |
| | | } |
| | | } else { |
| | | // æ°å¢è®°å½ |
| | | this.recordForm.id = Date.now(); |
| | | this.recordList.push({ ...this.recordForm }); |
| | | } |
| | |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | // éä»¶ç¸å
³æ¹æ³ |
| | | // å¹å
»è®°å½éä»¶ç¸å
³æ¹æ³ |
| | | handleCultureAttachmentChange(fileList) { |
| | | this.cultureForm.attachments = fileList; |
| | | this.cultureFileList = fileList; |
| | | }, |
| | | |
| | | handleCultureUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.cultureForm.attachments)) { |
| | | this.cultureForm.attachments = []; |
| | | } |
| | | |
| | | this.cultureForm.attachments.push(attachmentObj); |
| | | this.cultureFileList = fileList; |
| | | this.$message.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | }, |
| | | |
| | | handleCultureUploadError({ file, fileList, error }) { |
| | | console.error("å¹å
»è®°å½éä»¶ä¸ä¼ 失败:", error); |
| | | this.$message.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | }, |
| | | |
| | | handleCultureAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.cultureForm.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.cultureForm.attachments.splice(index, 1); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // æ¤çè®°å½éä»¶ç¸å
³æ¹æ³ |
| | | handleRecordAttachmentChange(fileList) { |
| | | this.recordForm.attachments = fileList; |
| | | this.recordFileList = fileList; |
| | | }, |
| | | |
| | | handleRecordUploadSuccess({ file, fileList, response }) { |
| | | if (response.code === 200) { |
| | | const attachmentObj = { |
| | | fileName: file.name, |
| | | path: response.fileUrl || file.url, |
| | | fileUrl: response.fileUrl || file.url, |
| | | fileType: this.getFileExtension(file.name), |
| | | fileSize: file.size, |
| | | uploadTime: dayjs().format("YYYY-MM-DD HH:mm:ss") |
| | | }; |
| | | |
| | | if (!Array.isArray(this.recordForm.attachments)) { |
| | | this.recordForm.attachments = []; |
| | | } |
| | | |
| | | this.recordForm.attachments.push(attachmentObj); |
| | | this.recordFileList = fileList; |
| | | this.$message.success("æä»¶ä¸ä¼ æå"); |
| | | } |
| | | }, |
| | | |
| | | handleRecordUploadError({ file, fileList, error }) { |
| | | console.error("æ¤çè®°å½éä»¶ä¸ä¼ 失败:", error); |
| | | this.$message.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | }, |
| | | |
| | | handleRecordAttachmentRemove(file) { |
| | | if (file.url) { |
| | | const index = this.recordForm.attachments.findIndex( |
| | | item => item.path === file.url || item.fileUrl === file.url |
| | | ); |
| | | if (index > -1) { |
| | | this.recordForm.attachments.splice(index, 1); |
| | | this.$message.success("éä»¶å 餿å"); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleViewCultureAttachments(row) { |
| | |
| | | this.currentAttachmentList = row.attachments || []; |
| | | this.attachmentPreviewTitle = `æ¤çæ ¸æ¥è®°å½éä»¶ - ${row.recorder}`; |
| | | this.attachmentPreviewVisible = true; |
| | | }, |
| | | |
| | | handleAttachmentPreviewClose() { |
| | | this.currentAttachmentList = []; |
| | | this.attachmentPreviewTitle = ""; |
| | | }, |
| | | |
| | | handlePreviewAttachment(file) { |
| | | this.currentPreviewFile = { |
| | | fileName: file.fileName, |
| | | fileUrl: file.path || file.fileUrl, |
| | | fileType: this.getFileType(file.fileName) |
| | | }; |
| | | this.filePreviewVisible = true; |
| | | }, |
| | | |
| | | handleDownloadAttachment(file) { |
| | | const fileUrl = file.path || file.fileUrl; |
| | | const fileName = file.fileName; |
| | | |
| | | if (fileUrl) { |
| | | const link = document.createElement("a"); |
| | | link.href = fileUrl; |
| | | link.download = fileName; |
| | | link.style.display = "none"; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | this.$message.success("å¼å§ä¸è½½æä»¶"); |
| | | } else { |
| | | this.$message.warning("æä»¶è·¯å¾ä¸åå¨ï¼æ æ³ä¸è½½"); |
| | | } |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»å */ |
| | | getFileType(fileName) { |
| | | if (!fileName) return "other"; |
| | | const extension = fileName.split(".").pop().toLowerCase(); |
| | | const imageTypes = ["jpg", "jpeg", "png", "gif", "bmp", "webp"]; |
| | | const pdfTypes = ["pdf"]; |
| | | const officeTypes = ["doc", "docx", "xls", "xlsx", "ppt", "pptx"]; |
| | | if (imageTypes.includes(extension)) return "image"; |
| | | if (pdfTypes.includes(extension)) return "pdf"; |
| | | if (officeTypes.includes(extension)) return "office"; |
| | | return "other"; |
| | | }, |
| | | |
| | | /** è·åæä»¶å¾æ é¢è² */ |
| | | getFileIconColor(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const colorMap = { |
| | | image: "#67C23A", |
| | | pdf: "#F56C6C", |
| | | office: "#409EFF", |
| | | other: "#909399" |
| | | }; |
| | | return colorMap[type] || "#909399"; |
| | | }, |
| | | |
| | | /** è·åæä»¶æ ç¾ç±»å */ |
| | | getFileTagType(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const typeMap = { |
| | | image: "success", |
| | | pdf: "danger", |
| | | office: "primary", |
| | | other: "info" |
| | | }; |
| | | return typeMap[type] || "info"; |
| | | }, |
| | | |
| | | /** è·åæä»¶ç±»åææ¬ */ |
| | | getFileTypeText(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | const textMap = { |
| | | image: "å¾ç", |
| | | pdf: "PDF", |
| | | office: "ææ¡£", |
| | | other: "å
¶ä»" |
| | | }; |
| | | return textMap[type] || "æªç¥"; |
| | | }, |
| | | |
| | | /** æ£æ¥æ¯å¦å¯é¢è§ */ |
| | | isPreviewable(fileName) { |
| | | const type = this.getFileType(fileName); |
| | | return ["image", "pdf"].includes(type); |
| | | }, |
| | | |
| | | /** è·åæä»¶æ©å±å */ |
| | | getFileExtension(filename) { |
| | | return filename.split(".").pop().toLowerCase(); |
| | | }, |
| | | |
| | | /** æ ¼å¼åæä»¶å¤§å° */ |
| | | formatFileSize(bytes) { |
| | | if (!bytes || bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }, |
| | | |
| | | /** æ¥ææ¶é´æ ¼å¼å */ |
| | | formatDateTime(dateTime) { |
| | | if (!dateTime) return ""; |
| | | try { |
| | | const date = new Date(dateTime); |
| | | if (isNaN(date.getTime())) return dateTime; |
| | | const year = date.getFullYear(); |
| | | const month = String(date.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(date.getDate()).padStart(2, "0"); |
| | | const hours = String(date.getHours()).padStart(2, "0"); |
| | | const minutes = String(date.getMinutes()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}`; |
| | | } catch (error) { |
| | | return dateTime; |
| | | } |
| | | }, |
| | | |
| | | // è¯ä¼°æ°æ®åæ´å¤ç |
| | |
| | | .fixed-width .el-button { |
| | | margin: 0 2px; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 13px; |
| | | margin-left: 8px; |
| | | } |
| | | </style> |
| | |
| | | components: { |
| | | TerminateRestoreModal |
| | | }, |
| | | dicts: ["sys_donornode",'sys_BloodType', "sys_EthicalReview", "sys_BaseAssessConclusion"], |
| | | dicts: [ |
| | | "sys_donornode", |
| | | "sys_BloodType", |
| | | "sys_EthicalReview", |
| | | "sys_BaseAssessConclusion" |
| | | ], |
| | | data() { |
| | | return { |
| | | loading: false, |
| | |
| | | |
| | | /** æ¥ç详æ
*/ |
| | | handleDetail(row) { |
| | | this.currentRecord = { ...row }; |
| | | this.detailVisible = true; |
| | | this.$router.push({ |
| | | path: "/case/course", |
| | | query: { id: row.id, organType: "edit" } |
| | | }); |
| | | }, |
| | | |
| | | /** ç»æ¢æä½ */ |
| | |
| | | <el-col :span="6"> |
| | | <el-form-item label="æ§å«" prop="sex"> |
| | | <el-select v-model="formData.sex" placeholder="è¯·éæ©æ§å«"> |
| | | <el-option label="æªç¥" value="0" /> |
| | | <el-option label="ç·" value="1" /> |
| | | <el-option label="女" value="2" /> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_user_sex || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | v-model="formData.idcardtype" |
| | | placeholder="è¯·éæ©è¯ä»¶ç±»å" |
| | | > |
| | | <el-option label="身份è¯" :value="1" /> |
| | | <el-option label="å人è¯" :value="2" /> |
| | | <el-option label="æ¤ç
§" :value="3" /> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_IDType || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="parseInt(dict.value)" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-form-item label="æ°æ" prop="nation"> |
| | | <el-select v-model="formData.nation" placeholder="è¯·éæ©æ°æ"> |
| | | <el-option |
| | | v-for="dict in dictOptions.sys_nation" |
| | | v-for="dict in dict.type.sys_nation || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | placeholder="è¯·éæ©å¦å" |
| | | > |
| | | <el-option |
| | | v-for="dict in dictOptions.sys_education" |
| | | v-for="dict in dict.type.sys_education || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | placeholder="è¯·éæ©èä¸" |
| | | > |
| | | <el-option |
| | | v-for="dict in dictOptions.sys_occupation" |
| | | v-for="dict in dict.type.sys_occupation || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è¡å" prop="bloodtype"> |
| | | <el-radio-group v-model="formData.bloodtype"> |
| | | <el-radio label="1">Aå</el-radio> |
| | | <el-radio label="2">Bå</el-radio> |
| | | <el-radio label="3">Oå</el-radio> |
| | | <el-radio label="4">ABå</el-radio> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_BloodType || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | v-for="dict in dict.type.sys_bloodtype_rhd || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio> |
| | | >{{ dict.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- ç¾ç
ç±»å --> |
| | | <el-row> |
| | | <el-form-item label="ç¾ç
ç±»å" align="left"> |
| | | <el-checkbox-group v-model="formData.diseasetype"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_DiseaseType || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | <el-form-item label="å
¶ä»" prop="diseasetypeOther"> |
| | | <el-input |
| | | v-model="formData.diseasetypeOther" |
| | | placeholder="请è¾å
¥å
¶ä»" |
| | | /> |
| | | </el-form-item> |
| | | </el-row> |
| | | |
| | | <!-- ä¼ æç
--> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item align="left" label="ä¼ æç
"> |
| | | <el-checkbox-group v-model="formData.infectious"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_Infectious || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item align="left" label="å
¶ä»" prop="infectiousOther"> |
| | | <el-input |
| | | v-model="formData.infectiousOther" |
| | | placeholder="请è¾å
¥å
¶ä»" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- ç
人ç¶åµåå
¶ä»æ
åµ --> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-form-item align="left" label="ç
人ç¶åµ"> |
| | | <el-checkbox-group v-model="formData.patientstate"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_patientstate || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="15" align="left"> |
| | | <el-form-item label="å
¶ä»æ
åµ"> |
| | | <el-checkbox-group v-model="formData.othercases"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_OtherCases || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | </el-card> |
| | | |
| | | <!-- ææ¿å亲å±ä¿¡æ¯é¨å --> |
| | | <el-card header="ææ¿å亲å±ä¿¡æ¯" class="form-section"> |
| | | <!-- æ¬äººææ¿ --> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item align="left" label="æ¬äººææ¿ "> |
| | | <el-checkbox-group v-model="formData.selfwill"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_SelfWill || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 亲å±ç¶åµ --> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item |
| | | label="亲å±ç¶åµ" |
| | | prop="kinship" |
| | | class="relation" |
| | | align="left" |
| | | > |
| | | <el-checkbox-group v-model="formData.kinship"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_Kinship || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="å
¶ä»" prop="kinshipOther"> |
| | | <el-input |
| | | v-model="formData.kinshipOther" |
| | | placeholder="请è¾å
¥å
¶ä»" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 主è¦äº²å± --> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="主è¦äº²å±" prop="majorrelatives"> |
| | | <el-input |
| | | v-model="formData.majorrelatives" |
| | | placeholder="请è¾å
¥ä¸»è¦äº²å±" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ä¸æèµ è
å
³ç³»" prop="familyrelations"> |
| | | <el-select |
| | | v-model="formData.familyrelations" |
| | | placeholder="è¯·éæ©ä¸æèµ è
å
³ç³»" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.sys_FamilyRelation || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- ä¿¡æ¯æ¥æº --> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item align="left" label="ä¿¡æ¯æ¥æº"> |
| | | <el-checkbox-group v-model="formData.infosources"> |
| | | <el-checkbox |
| | | v-for="dict in dict.type.sys_InfoSources || []" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | > |
| | | {{ dict.label }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="å
¶ä»" prop="infosourcesOther"> |
| | | <el-input |
| | | v-model="formData.infosourcesOther" |
| | | placeholder="请è¾å
¥ä¿¡æ¯æ¥æºå
¶ä»" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- ä¿¡æ¯å --> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-form-item label="ä¿¡æ¯å" prop="infoname"> |
| | | <el-input |
| | | v-model="formData.infoname" |
| | | placeholder="请è¾å
¥ä¿¡æ¯å" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="èç³»çµè¯" prop="infophone"> |
| | | <el-input |
| | | v-model="formData.infophone" |
| | | placeholder="请è¾å
¥ä¿¡æ¯åèç³»çµè¯" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | |
| | | <!-- æç®ä¿¡æ¯é¨å --> |
| | | <el-card header="æç®ä¿¡æ¯" class="form-section"> |
| | | <el-row :gutter="20"> |
| | |
| | | placeholder="è¯·éæ©æç®ç±»å«" |
| | | > |
| | | <el-option |
| | | v-for="dict in dictOptions.sys_DonationCategory" |
| | | v-for="dict in dict.type.sys_DonationCategory || []" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | |
| | | <el-input |
| | | v-model="formData.acquisitiontissuename" |
| | | placeholder="请è¾å
¥è·åç»ç»åç§°" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- 红ååä¼åè系人 --> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-form-item align="left" label="红ååä¼" prop="redorganno"> |
| | | <org-selecter |
| | | ref="addCrossOrgSelect" |
| | | :org-type="'2'" |
| | | v-model="formData.redorganno" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="è系人" prop="contactperson"> |
| | | <el-input |
| | | v-model="formData.contactperson" |
| | | placeholder="请è¾å
¥è系人" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="èç³»æ¶é´" prop="contacttime"> |
| | | <el-date-picker |
| | | v-model="formData.contacttime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="éæ©æ¥åæ¶é´" |
| | | style="width: 100%" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | LiAreaSelect |
| | | }, |
| | | |
| | | dicts: ["sys_bloodtype_rhd", "sys_BloodType"], |
| | | // æ·»å ææéè¦çåå
¸ç±»å |
| | | dicts: [ |
| | | "sys_bloodtype_rhd", |
| | | "sys_BloodType", |
| | | "sys_user_sex", |
| | | "sys_IDType", |
| | | "sys_nation", |
| | | "sys_education", |
| | | "sys_occupation", |
| | | "sys_DiseaseType", |
| | | "sys_Infectious", |
| | | "sys_patientstate", |
| | | "sys_OtherCases", |
| | | "sys_SelfWill", |
| | | "sys_Kinship", |
| | | "sys_FamilyRelation", |
| | | "sys_InfoSources", |
| | | "sys_DonationCategory" |
| | | ], |
| | | |
| | | props: { |
| | | visible: { |
| | |
| | | return this.visible; |
| | | }, |
| | | set(value) { |
| | | this.$emit('update:visible', value); |
| | | this.$emit("update:visible", value); |
| | | if (!value) { |
| | | this.handleClose(); |
| | | } |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | console.log('EditCaseModal created'); |
| | | console.log('visible:', this.visible); |
| | | console.log('editData:', this.editData); |
| | | console.log("EditCaseModal created"); |
| | | console.log("visible:", this.visible); |
| | | console.log("editData:", this.editData); |
| | | }, |
| | | mounted() { |
| | | console.log('EditCaseModal mounted'); |
| | | console.log('visible:', this.visible); |
| | | console.log('editData:', this.editData); |
| | | console.log('isEdit:', this.isEdit); |
| | | console.log("EditCaseModal mounted"); |
| | | console.log("visible:", this.visible); |
| | | console.log("editData:", this.editData); |
| | | console.log("isEdit:", this.isEdit); |
| | | }, |
| | | methods: { |
| | | getDefaultFormData() { |
| | |
| | | illnessoverview: null, |
| | | coordinatorNo: null, |
| | | coordinatorName: null, |
| | | diseasetype: [], |
| | | infectious: [], |
| | | patientstate: [], |
| | | othercases: [], |
| | | |
| | | // å°åä¿¡æ¯ |
| | | residenceaddress: null, |
| | | residenceprovince: null, |
| | | residencecity: null, |
| | | residencetown: null, |
| | | registeraddress: null, |
| | | registerprovince: null, |
| | | registercity: null, |
| | | registertown: null, |
| | | |
| | | // ææ¿å亲å±ä¿¡æ¯ |
| | | selfwill: [], |
| | | kinship: [], |
| | | majorrelatives: null, |
| | | familyrelations: null, |
| | | infosources: [], |
| | | infoname: null, |
| | | infophone: null, |
| | | redorganno: null, |
| | | contactperson: null, |
| | | contacttime: null, |
| | | |
| | | // æç®ä¿¡æ¯ |
| | | donationcategory: null, |
| | |
| | | reporttime: null, |
| | | deptid: null, |
| | | |
| | | // æ°ç»å段 |
| | | diseasetype: [], |
| | | infectious: [], |
| | | selfwill: [], |
| | | othercases: [], |
| | | infosources: [], |
| | | kinship: [], |
| | | patientstate: [] |
| | | // å
¶ä»å段 |
| | | diseasetypeOther: null, |
| | | infectiousOther: null, |
| | | kinshipOther: null, |
| | | infosourcesOther: null |
| | | }; |
| | | }, |
| | | |
| | | async initForm() { |
| | | console.log('åå§å表åï¼isEdit:', this.isEdit); |
| | | console.log("åå§å表åï¼isEdit:", this.isEdit); |
| | | try { |
| | | if (this.isEdit && this.editData && this.editData.id) { |
| | | console.log('å è½½ç¼è¾æ°æ®ï¼id:', this.editData.id); |
| | | console.log("å è½½ç¼è¾æ°æ®ï¼id:", this.editData.id); |
| | | await this.loadEditData(); |
| | | } else { |
| | | console.log('æ°å¢æ¨¡å¼ï¼åå§å表å'); |
| | | console.log("æ°å¢æ¨¡å¼ï¼åå§å表å"); |
| | | this.formData = this.getDefaultFormData(); |
| | | this.formData.nationality = "ä¸å½"; |
| | | this.formData.bloodtype = "0"; |
| | |
| | | try { |
| | | const response = await getDonatebaseinfo(this.editData.id); |
| | | const data = response.data; |
| | | console.log('å è½½å°çæ°æ®:', data); |
| | | console.log("å è½½å°çæ°æ®:", data); |
| | | |
| | | // å¤çæ°ç»å段 |
| | | const arrayFields = [ |
| | |
| | | "patientstate" |
| | | ]; |
| | | arrayFields.forEach(field => { |
| | | if (data[field]) { |
| | | if (data[field] && typeof data[field] === "string") { |
| | | data[field] = data[field].split(","); |
| | | } else { |
| | | } else if (!data[field]) { |
| | | data[field] = []; |
| | | } |
| | | }); |
| | | |
| | | this.formData = { ...this.getDefaultFormData(), ...data }; |
| | | console.log('åå¹¶åçformData:', this.formData); |
| | | console.log("åå¹¶åçformData:", this.formData); |
| | | |
| | | // 设置å°åä¿¡æ¯ |
| | | if (data.residenceprovince) { |
| | |
| | | }, |
| | | |
| | | handleClose() { |
| | | console.log('å
³éå¼¹æ¡'); |
| | | console.log("å
³éå¼¹æ¡"); |
| | | this.isEdit = false; |
| | | this.submitLoading = false; |
| | | this.formData = this.getDefaultFormData(); |
| | |
| | | this.submitLoading = true; |
| | | try { |
| | | const submitData = this.processSubmitData(); |
| | | console.log('æäº¤æ°æ®:', submitData); |
| | | console.log("æäº¤æ°æ®:", submitData); |
| | | |
| | | const result = await updateDonatebaseinfo(submitData); |
| | | if (result.code === 200) { |
| | | this.$message.success(this.isEdit ? "æ´æ°æå" : "æ°å¢æå"); |
| | | this.$emit("success", result.data); |
| | | console.log(1122); |
| | | |
| | | this.handleClose(); |
| | | } else { |
| | | this.$message.error(result.msg || "æä½å¤±è´¥"); |
| | |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | } |
| | | if (data.contacttime) { |
| | | data.contacttime = this.$moment(data.contacttime).format( |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | } |
| | | |
| | | // 设置é»è®¤å¼ |
| | | if (!data.recordstate) { |
| | |
| | | /** å¤çç¼è¾å¼¹çªå
³é */ |
| | | handleEditClosed() { |
| | | this.currentEditData = {}; |
| | | this.editModalVisible = false; |
| | | }, |
| | | |
| | | handleModalVisibleChange(newVisible) { |