| | |
| | | |
| | | <script setup> |
| | | import {onMounted, ref} from "vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {ElMessageBox, ElMessage} from "element-plus"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue"; |
| | | import {ledgerRecordListPage} from "@/api/equipmentManagement/calibration.js"; |
| | | import {ledgerRecordListPage, ledgerRecordDelete} from "@/api/equipmentManagement/calibration.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore() |
| | | |
| | |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | width: 100, |
| | | align: "center", |
| | | fixed: 'right', |
| | | operation: [ |
| | |
| | | clickFun: (row) => { |
| | | openCalibrationDia("edit", row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.userId !== userStore.id |
| | | } |
| | | }, |
| | | { |
| | | name: "删除", |
| | | type: "text", |
| | | style: { |
| | | color: "#F56C6C" |
| | | }, |
| | | clickFun: (row) => { |
| | | handleDelete(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | }) |
| | | } |
| | | |
| | | // 删除记录 |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm(`确认删除计量器具编号为"${row.code}"的检定记录吗?`, "删除确认", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | ledgerRecordDelete([row.id]).then(() => { |
| | | ElMessage.success("删除成功"); |
| | | getList(); |
| | | }).catch(() => { |
| | | ElMessage.error("删除失败"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消删除"); |
| | | }); |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |