| | |
| | | |
| | | <script> |
| | | import { listPatouthosp } from "@/api/smartor/patouthosp"; |
| | | import { loadArchives, saveArchives, buildArchiveRecord } from "../types"; |
| | | import { createArchive } from "../apiAdapter"; |
| | | import store from "@/store"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | handleConfirm() { |
| | | if (!this.currentRow) return; |
| | | const record = buildArchiveRecord(this.currentRow, this.type, this.sourcePage); |
| | | const all = loadArchives(); |
| | | all.push(record); |
| | | saveArchives(all); |
| | | this.dialogVisible = false; |
| | | this.$emit("picked", record); |
| | | this.loading = true; |
| | | createArchive(this.currentRow, this.type, this.sourcePage || "outpatient") |
| | | .then((record) => { |
| | | this.dialogVisible = false; |
| | | this.$emit("picked", record); |
| | | }) |
| | | .catch(() => {}) |
| | | .finally(() => { this.loading = false; }); |
| | | }, |
| | | handleClose() { |
| | | this.currentRow = null; |