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 |  124 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 102 insertions(+), 22 deletions(-)

diff --git a/src/views/inspectionManagement/index.vue b/src/views/inspectionManagement/index.vue
index e3eaff1..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"
@@ -63,15 +88,30 @@
         />
       </div>
     </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>
 
 <script setup>
 import {Download, Delete, Plus} from "@element-plus/icons-vue";
 import {onMounted, ref} from "vue";
+const { proxy } = getCurrentInstance()
 import Pagination from "@/components/Pagination/index.vue";
 import ETable from "@/components/Table/ETable.vue";
+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: "",
@@ -79,36 +119,35 @@
 })
 // 褰撳墠鏍囩
 const activeTab = ref("task");
-const tabName = ref("qrCode");
+const tabName = ref("task");
 // 鏍囩椤垫暟鎹�
 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);
 const pageSize = ref(10);
 const columns = ref([
-  { prop: "saleDate", label: "閿�鍞棩鏈�", minWidth: 160 },
-  { prop: "customer", label: "瀹㈡埛", minWidth: 120 },
-  { prop: "coal", label: "鐓ょ", minWidth: 150 },
-  { prop: "unit", label: "鍗曚綅", minWidth: 150 },
-  { prop: "priceIncludingTax", label: "鍗曚环(鍚◣)", minWidth: 150 },
-  { prop: "inventoryQuantity", label: "搴撳瓨鏁伴噺", minWidth: 120 },
-  { prop: "saleQuantity", label: "閿�鍞暟閲�", minWidth: 120 },
-  { prop: "salePrice", label: "閿�鍞崟浠�(鍚◣)", minWidth: 150 },
-  { prop: "totalAmount", label: "閿�鍞�讳环(鍚◣)", minWidth: 120 },
-  { prop: "freight", label: "杩愯垂", minWidth: 90 },
-  { prop: "taxCoal", label: "璐攢鐓ょ◣鐜�(%)", minWidth: 120 },
-  { prop: "taxTrans", label: "杩愯緭绋庣巼(%)", minWidth: 120 },
-  { prop: "grossProfit", label: "姣涘埄娑�", minWidth: 90 },
-  { prop: "netProfit", label: "鍑�鍒╂鼎", minWidth: 90 },
+  { prop: "taskName", label: "宸℃浠诲姟鍚嶇О", minWidth: 160 },
+  { prop: "port", label: "鍦扮偣", minWidth: 120 },
+  { prop: "remarks", label: "澶囨敞", minWidth: 150 },
+  { prop: "inspector", label: "鎵ц宸℃浜�", minWidth: 150 },
   { prop: "registrant", label: "鐧昏浜�", minWidth: 100 },
-  { prop: "registrationDate", 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(() => {
@@ -118,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();
 };
 // 鐐瑰嚮鏌ヨ
@@ -127,7 +173,26 @@
   getList()
 }
 const getList = () => {
-  // tableLoading.value = true;
+  tableLoading.value = true;
+  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;
+    })
+  }
   
 };
 // 閲嶇疆鏌ヨ
@@ -142,8 +207,23 @@
 
 // 鏂板銆佺紪杈�
 const handleAdd = (row) => {
-
+  const type = row === undefined ? 'add' : 'edit'
+  nextTick(() => {
+    if (tabName.value === "task") {
+      formDia.value?.openDialog(type, row)
+    } 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) {
@@ -152,7 +232,7 @@
   }
   const deleteIds = selectedRows.value.map(item => item.id);
   proxy.$modal.confirm('鏄惁纭鍒犻櫎鎵�閫夋暟鎹」锛�').then(function() {
-    return delSalesRecord(deleteIds)
+    return delQrCode(deleteIds)
   }).then(() => {
     handleQuery()
     proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛")

--
Gitblit v1.9.3