From 95f44bd509e286290a18639531de3e05768c3a90 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 24 六月 2025 16:46:07 +0800
Subject: [PATCH] 1.巡检管理-二维码管理联调 2.巡检管理-现场巡检记录开发联调 3.巡检上传-现场巡检开发联调
---
src/views/inspectionManagement/index.vue | 92 ++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 81 insertions(+), 11 deletions(-)
diff --git a/src/views/inspectionManagement/index.vue b/src/views/inspectionManagement/index.vue
index bb313fd..54be49f 100644
--- a/src/views/inspectionManagement/index.vue
+++ b/src/views/inspectionManagement/index.vue
@@ -37,7 +37,7 @@
/>
</el-tabs>
<!-- 鎿嶄綔鎸夐挳鍖� -->
- <el-space>
+ <el-space v-if="tabName !== 'qrCodeScanRecord'">
<el-button type="primary" :icon="Plus" @click="handleAdd">鏂板缓</el-button>
<el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
<el-button type="info" plain :icon="Download">瀵煎嚭</el-button>
@@ -46,12 +46,37 @@
<div>
<ETable :loading="tableLoading"
:table-data="tableData"
- :columns="columns"
+ :columns="tableColumns"
@selection-change="handleSelectionChange"
:show-selection="true"
:border="true"
:maxHeight="480"
- @edit="handleAdd"></ETable>
+ operationsWidth="130"
+ :operations="operationsArr"
+ @edit="handleAdd"
+ @viewFile="viewFile"
+ v-if="tabName !== 'qrCodeScanRecord'"
+ ></ETable>
+ <el-table ref="table" :data="tableData" height="480" v-loading="tableLoading" v-else>
+ <el-table-column label="搴忓彿" type="index" width="60" align="center" />
+ <el-table-column prop="deviceName" label="璁惧鍚嶇О" :show-overflow-tooltip="true">
+ <template #default="scope">
+ {{scope.row.qrCode.deviceName}}
+ </template>
+ </el-table-column>
+ <el-table-column prop="location" label="鎵�鍦ㄤ綅缃弿杩�" :show-overflow-tooltip="true">
+ <template #default="scope">
+ {{scope.row.qrCode.location}}
+ </template>
+ </el-table-column>
+ <el-table-column prop="scanner" label="宸℃浜�"></el-table-column>
+ <el-table-column prop="scanTime" label="宸℃鏃堕棿"></el-table-column>
+ <el-table-column fixed="right" label="鎿嶄綔">
+ <template #default="scope">
+ <el-button link type="primary" @click="handleAdd(scope.row)">鏌ョ湅闄勪欢</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
</div>
<pagination
v-if="total>0"
@@ -65,6 +90,8 @@
</el-card>
<form-dia ref="formDia" @closeDia="handleQuery"></form-dia>
<qr-code-dia ref="qrCodeDia" @closeDia="handleQuery"></qr-code-dia>
+ <view-files ref="viewFiles"></view-files>
+ <view-qr-code-files ref="viewQrCodeFiles"></view-qr-code-files>
</div>
</template>
@@ -77,9 +104,14 @@
import FormDia from "@/views/inspectionManagement/components/formDia.vue";
import QrCodeDia from "@/views/inspectionManagement/components/qrCodeDia.vue";
import {delInspectionTask, inspectionTaskList} from "@/api/inspectionManagement/index.js";
+import ViewFiles from "@/views/inspectionManagement/components/viewFiles.vue";
+import {delQrCode, qrCodeList, qrCodeScanRecordList} from "@/api/inspectionUpload/index.js";
+import ViewQrCodeFiles from "@/views/inspectionManagement/components/viewQrCodeFiles.vue";
const formDia = ref()
const qrCodeDia = ref()
+const viewFiles = ref()
+const viewQrCodeFiles = ref()
// 鏌ヨ鍙傛暟
const queryParams = reactive({
supplierName: "",
@@ -92,10 +124,13 @@
const tabs = reactive([
{ name: "task", label: "浠诲姟涓嬪彂" },
{ name: "qrCode", label: "浜岀淮鐮佺鐞�" },
+ { name: "qrCodeScanRecord", label: "鐜板満宸℃璁板綍" },
]);
// 琛ㄦ牸
const selectedRows = ref([]);
const tableData = ref([]);
+const operationsArr = ref([]);
+const tableColumns = ref([]);
const tableLoading = ref(false);
const total = ref(0);
const pageNum = ref(1);
@@ -108,6 +143,12 @@
{ prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
{ prop: "createTime", label: "鐧昏鏃ユ湡", minWidth: 100 },
]);
+const columns1 = ref([
+ { prop: "deviceName", label: "璁惧鍚嶇О", minWidth: 160 },
+ { prop: "location", label: "鎵�鍦ㄤ綅缃弿杩�", minWidth: 120 },
+ { prop: "createBy", label: "鍒涘缓鑰�", minWidth: 100 },
+ { prop: "createTime", label: "鍒涘缓鏃堕棿", minWidth: 100 },
+]);
onMounted(() => {
handleTabClick({ props: { name: "task" } });
@@ -116,6 +157,13 @@
const handleTabClick = (tab) => {
tabName.value = tab.props.name;
tableData.value = [];
+ if (tabName.value === "task") {
+ tableColumns.value = columns.value;
+ operationsArr.value = ['edit', 'viewFile']
+ } else {
+ tableColumns.value = columns1.value;
+ operationsArr.value = ['edit']
+ }
getList();
};
// 鐐瑰嚮鏌ヨ
@@ -126,12 +174,26 @@
}
const getList = () => {
tableLoading.value = true;
- inspectionTaskList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => {
- console.log(res)
- tableLoading.value = false;
- tableData.value = res.data.records;
- total.value = res.data.total;
- })
+ if (tabName.value === "task") {
+ inspectionTaskList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ })
+ } else if (tabName.value === "qrCode") {
+ qrCodeList({...queryParams, size: pageSize.value, current: pageNum.value}).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ })
+ } else {
+ qrCodeScanRecordList({size: pageSize.value, current: pageNum.value}).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ total.value = res.data.total;
+ })
+ }
+
};
// 閲嶇疆鏌ヨ
const resetQuery = () => {
@@ -149,11 +211,19 @@
nextTick(() => {
if (tabName.value === "task") {
formDia.value?.openDialog(type, row)
- } else {
+ } else if (tabName.value === "qrCode") {
qrCodeDia.value?.openDialog(type, row)
+ } else {
+ viewQrCodeFiles.value?.openDialog(row)
}
})
};
+// 鏌ョ湅闄勪欢
+const viewFile = (row) => {
+ nextTick(() => {
+ viewFiles.value?.openDialog(row)
+ })
+}
// 鍒犻櫎浠诲姟
const handleDelete = () => {
if (selectedRows.value.length === 0) {
@@ -162,7 +232,7 @@
}
const deleteIds = selectedRows.value.map(item => item.id);
proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() {
- return delInspectionTask(deleteIds)
+ return delQrCode(deleteIds)
}).then(() => {
handleQuery()
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")
--
Gitblit v1.9.3