gaoluyang
6 小时以前 076bb96b437258f0e8cdbe184040e1e302b60d4b
src/views/equipmentManagement/calibration/index.vue
@@ -57,10 +57,10 @@
<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()
@@ -134,6 +134,7 @@
   {
      dataType: "action",
      label: "操作",
      width: 100,
      align: "center",
      fixed: 'right',
      operation: [
@@ -143,9 +144,16 @@
            clickFun: (row) => {
               openCalibrationDia("edit", row);
            },
            disabled: (row) => {
               return row.userId !== userStore.id
            }
         },
         {
            name: "删除",
            type: "text",
            style: {
               color: "#F56C6C"
            },
            clickFun: (row) => {
               handleDelete(row);
            },
         },
      ],
   },
@@ -194,6 +202,26 @@
   })
}
// 删除记录
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("选中的内容将被导出,是否确认导出?", "导出", {