From 7bbab0e74d1d0208fa24ec67e3201427078980cd Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期日, 04 一月 2026 17:01:59 +0800
Subject: [PATCH] 器具校准,校准记录

---
 src/views/measurementEquipment/index.vue |  270 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 270 insertions(+), 0 deletions(-)

diff --git a/src/views/measurementEquipment/index.vue b/src/views/measurementEquipment/index.vue
new file mode 100644
index 0000000..58bb003
--- /dev/null
+++ b/src/views/measurementEquipment/index.vue
@@ -0,0 +1,270 @@
+<template>
+	<div class="app-container">
+		<div class="search_form">
+			<div>
+				<span class="search_title">褰曞叆鏃ユ湡锛�</span>
+				<el-date-picker
+					v-model="searchForm.recordDate"
+					value-format="YYYY-MM-DD"
+					format="YYYY-MM-DD"
+					type="date"
+					placeholder="璇烽�夋嫨"
+					clearable
+					style="width: 160px"
+					@change="handleQuery"
+				/>
+				<span class="search_title ml10">璁¢噺鍣ㄥ叿缂栧彿锛�</span>
+				<el-input v-model="searchForm.code" placeholder="璇疯緭鍏ョ紪鍙�" clearable style="width: 240px" @change="handleQuery"/>
+				<span class="search_title ml10">鐘舵�侊細</span>
+				<el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 160px" clearable>
+					<el-option label="鏈夋晥" :value="1"></el-option>
+					<el-option label="閫炬湡" :value="2"></el-option>
+				</el-select>
+				<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
+				>鎼滅储</el-button
+				>
+			</div>
+			<div>
+				<el-button type="primary" @click="openForm('add')">鏂板璁¢噺鍣ㄥ叿</el-button>
+				<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+				<el-button @click="handleOut">瀵煎嚭</el-button>
+			</div>
+		</div>
+		<div class="table_list">
+			<PIMTable
+				rowKey="id"
+				:column="tableColumn"
+				:tableData="tableData"
+				:page="page"
+				:isSelection="true"
+				@selection-change="handleSelectionChange"
+				:tableLoading="tableLoading"
+				@pagination="pagination"
+			></PIMTable>
+		</div>
+		<form-dia ref="formDia" @close="handleQuery"></form-dia>
+		<calibration-dia ref="calibrationDia" @close="handleQuery"></calibration-dia>
+    <files-dia ref="filesDia"></files-dia>
+	</div>
+</template>
+
+<script setup>
+import {onMounted, ref} from "vue";
+import FormDia from "../measurementEquipment/components/formDia.vue";
+import {ElMessageBox} from "element-plus";
+import useUserStore from "../../store/modules/user.js";
+import CalibrationDia from "../measurementEquipment/components/calibrationDia.vue";
+import {
+	measuringInstrumentDelete,
+	measuringInstrumentListPage
+} from "../../api/equipmentManagement/measurementEquipment.js";
+import FilesDia from "./filesDia.vue";
+const { proxy } = getCurrentInstance();
+const userStore = useUserStore()
+
+const data = reactive({
+	searchForm: {
+		recordDate: "",
+		code: "",
+		status: "",
+	},
+});
+const { searchForm } = toRefs(data);
+
+const tableColumn = ref([
+	{
+		label: "鐘舵��",
+		prop: "status",
+		dataType: "tag",
+		formatData: (params) => {
+			if (params == 1) {
+				return "鏈夋晥";
+			} else if (params == 2) {
+				return "閫炬湡";
+			} else {
+				return null;
+			}
+		},
+		formatType: (params) => {
+			if (params == 1) {
+				return "success";
+			} else if (params == 2) {
+				return "danger";
+			} else {
+				return null;
+			}
+		},
+	},
+	{
+		label: "鏈�杩戜竴娆℃瀹氭棩鏈�",
+		prop: "mostDate",
+		width: 130,
+	},
+	{
+		label: "璁¢噺鍣ㄥ叿缂栧彿",
+		prop: "code",
+		width: 150,
+	},
+	{
+		label: "璁¢噺鍣ㄥ叿鍚嶇О",
+		prop: "name",
+		width: 200,
+	},
+	{
+		label: "瑙勬牸鍨嬪彿",
+		prop: "model",
+		width:200
+	},
+	{
+		label: "鏈夋晥鏈�",
+		prop: "valid",
+		width: 130,
+	},
+	{
+		label: "棰勮涓嬫妫�瀹氭棩鏈�",
+		prop: "nextDate",
+		width: 130,
+	},
+	{
+		label: "褰曞叆浜�",
+		prop: "userName",
+	},
+	{
+		label: "褰曞叆鏃ユ湡",
+		prop: "recordDate",
+		width: 130,
+	},
+	{
+		dataType: "action",
+		label: "鎿嶄綔",
+		align: "center",
+		width: '130',
+		fixed: 'right',
+		operation: [
+			{
+				name: "妫�瀹氭牎鍑�",
+				type: "text",
+				clickFun: (row) => {
+					openCalibrationDia("verifying", row);
+				},
+			},
+			// {
+			// 	name: "闄勪欢",
+			// 	type: "text",
+			// 	clickFun: (row) => {
+      //     openFilesFormDia(row);
+			// 	},
+			// },
+		],
+	},
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+const filesDia = ref()
+const page = reactive({
+	current: 1,
+	size: 100,
+	total: 0,
+});
+const selectedRows = ref([]);
+
+// 鎵撳紑闄勪欢寮规
+const openFilesFormDia = (row) => {
+  console.log(row)
+  nextTick(() => {
+    filesDia.value?.openDialog( row,'璁¢噺鍣ㄥ叿鍙拌处')
+  })
+};
+
+// 琛ㄦ牸閫夋嫨鏁版嵁
+const handleSelectionChange = (selection) => {
+	selectedRows.value = selection;
+};
+const formDia = ref()
+const calibrationDia = ref()
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+	page.current = 1;
+	getList();
+};
+const pagination = (obj) => {
+	page.current = obj.page;
+	page.size = obj.limit;
+	getList();
+};
+const getList = () => {
+	tableLoading.value = true;
+	measuringInstrumentListPage({ ...searchForm.value, ...page }).then((res) => {
+		tableLoading.value = false;
+		tableData.value = res.data.records;
+		page.total = res.data.total;
+	}).catch((err) => {
+		tableLoading.value = false;
+	})
+};
+
+// 鎵撳紑寮规
+const openForm = (type, row) => {
+	nextTick(() => {
+		formDia.value?.openDialog(type, row)
+	})
+};
+// 鎵撳紑妫�瀹氭牎鍑嗗脊妗�
+const openCalibrationDia = (type, row) => {
+	nextTick(() => {
+		calibrationDia.value?.openDialog(type, row)
+	})
+}
+
+const handleDelete = () => {
+	let ids = [];
+	if (selectedRows.value.length > 0) {
+		ids = selectedRows.value.map((item) => item.id);
+	} else {
+		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+		return;
+	}
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			tableLoading.value = true;
+			measuringInstrumentDelete(ids)
+				.then((res) => {
+					proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+					getList();
+				})
+				.finally(() => {
+					tableLoading.value = false;
+				});
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+// 瀵煎嚭
+const handleOut = () => {
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			proxy.download("/measuringInstrumentLedger/export", {}, "璁¢噺鍣ㄥ叿鍙拌处.xlsx");
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+onMounted(() => {
+	getList();
+});
+</script>
+
+<style scoped>
+
+</style>
\ No newline at end of file

--
Gitblit v1.9.3