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 | 79 ++++++++++++++++++++++++++++++++++----- 1 files changed, 68 insertions(+), 11 deletions(-) diff --git a/src/views/inspectionManagement/index.vue b/src/views/inspectionManagement/index.vue index 64bc036..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,16 +46,37 @@ <div> <ETable :loading="tableLoading" :table-data="tableData" - :columns="columns" + :columns="tableColumns" @selection-change="handleSelectionChange" :show-selection="true" :border="true" :maxHeight="480" operationsWidth="130" - :operations="['edit', 'viewFile']" + :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" @@ -70,6 +91,7 @@ <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> @@ -83,10 +105,13 @@ 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: "", @@ -99,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); @@ -115,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" } }); @@ -123,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(); }; // 鐐瑰嚮鏌ヨ @@ -133,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 = () => { @@ -156,8 +211,10 @@ 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) } }) }; @@ -175,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