zouyu
2 天以前 1c0863efe062af3ebcdecb8c10568d779f5c8295
src/views/equipmentManagement/calibration/index.vue
@@ -34,6 +34,7 @@
            <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
            >搜索</el-button
            >
            <el-button @click="handleReset" style="margin-left: 10px">重置</el-button>
         </div>
         <div>
            <el-button @click="handleOut">导出</el-button>
@@ -56,11 +57,11 @@
</template>
<script setup>
import {onMounted, ref} from "vue";
import {ElMessageBox} from "element-plus";
import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue";
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 +135,7 @@
   {
      dataType: "action",
      label: "操作",
      width: 140,
      align: "center",
      fixed: 'right',
      operation: [
@@ -143,9 +145,16 @@
            clickFun: (row) => {
               openCalibrationDia("edit", row);
            },
            disabled: (row) => {
               return row.userId !== userStore.id
            }
         },
         {
            name: "删除",
            type: "text",
            style: {
               color: "#F56C6C"
            },
            clickFun: (row) => {
               handleDelete(row);
            },
         },
      ],
   },
@@ -171,6 +180,15 @@
   page.current = 1;
   getList();
};
// 重置搜索条件
const handleReset = () => {
   searchForm.value.recordDate = "";
   searchForm.value.entryDate = "";
   searchForm.value.code = "";
   page.current = 1;
   getList();
};
const pagination = (obj) => {
   page.current = obj.page;
   page.size = obj.limit;
@@ -194,6 +212,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("选中的内容将被导出,是否确认导出?", "导出", {