| | |
| | | /> |
| | | </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> |
| | |
| | | <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" |
| | |
| | | <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> |
| | | |
| | |
| | | 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: "", |
| | |
| | | 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); |
| | |
| | | { 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" } }); |
| | |
| | | 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(); |
| | | }; |
| | | // 点击查询 |
| | |
| | | } |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | if (tabName.value === "task") { |
| | | 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; |
| | | }) |
| | | } 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 = () => { |
| | |
| | | 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 deleteIds = selectedRows.value.map(item => item.id); |
| | | proxy.$modal.confirm('是否确认删除所选数据项?').then(function() { |
| | | return delInspectionTask(deleteIds) |
| | | return delQrCode(deleteIds) |
| | | }).then(() => { |
| | | handleQuery() |
| | | proxy.$modal.msgSuccess("删除成功") |