| | |
| | | > |
| | | <el-table-column type="selection" width="55" v-if="permissionList.reviewBtn || permissionList.exportBtn" /> |
| | | <el-table-column type="index" label="序号" width="60" /> |
| | | <el-table-column prop="orderNumber" label="工单编号" width="170"> |
| | | <el-table-column prop="event_num" label="工单编号" width="170"> |
| | | <template #default="{ row }"> |
| | | <el-tooltip-copy :content="row.orderNumber" :showCopyText="true" textAlign="left"> |
| | | {{ row.orderNumber }} |
| | | <el-tooltip-copy :content="row.event_num" :showCopyText="true" textAlign="left"> |
| | | {{ row.event_num }} |
| | | </el-tooltip-copy> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="orderName" label="工单名称" width="150" show-overflow-tooltip> |
| | | <el-table-column prop="event_name" label="工单名称" width="150" show-overflow-tooltip> |
| | | <template #default="{ row }"> |
| | | <el-tooltip-copy :content="row.orderName" :showCopyText="true" textAlign="left"> |
| | | {{ row.orderName }} |
| | | <el-tooltip-copy :content="row.event_name" :showCopyText="true" textAlign="left"> |
| | | {{ row.event_name }} |
| | | </el-tooltip-copy> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | |
| | | <el-table-column prop="startTime" label="发起任务时间" width="160" show-overflow-tooltip /> |
| | | |
| | | <el-table-column prop="aiType" label="关联算法" show-overflow-tooltip /> |
| | | <el-table-column prop="ai_types" label="关联算法" show-overflow-tooltip /> |
| | | |
| | | <el-table-column prop="type" label="工单类型" width="110" show-overflow-tooltip> |
| | | <template #default="{ row }"> |
| | |
| | | currentDetail.value.processingDetail = currentDetail.value.processing_details |
| | | currentDetail.value.showQR = false |
| | | currentDetail.value.latAndLon = _.round(currentDetail.value.location[0], 6) + ',' + _.round(currentDetail.value.location[1], 6) |
| | | console.log('currentDetail.value',currentDetail.value); |
| | | |
| | | getStepInfoData(currentDetail.value.orderNumber) |
| | | } |
| | | |
| | |
| | | const longitude = Number(item.longitude) || 0 |
| | | const latitude = Number(item.latitude) || 0 |
| | | return { |
| | | ...item, |
| | | id: item.id, |
| | | orderNumber: item.event_num, |
| | | orderName: item.event_name, |
| | | // orderNumber: item.event_num, |
| | | // orderName: item.event_name, |
| | | department: departments.value.find(d => d.value === item.dept_id)?.label || item.dept_name, |
| | | startTime: item.job_create_time || '/', |
| | | aiType: item.ai_types, |
| | | // aiType: item.ai_types, |
| | | content: item.content, |
| | | type: item.work_order_type_dict_key, |
| | | keyData: !isNaN(longitude) && !isNaN(latitude) |
| | |
| | | |
| | | } |
| | | }) |
| | | console.log('tableData.value',tableData.value); |
| | | |
| | | page.total = total || 0 |
| | | if (isShowInfo.value) { |
| | |
| | | algorithms2.value = [] |
| | | return |
| | | } |
| | | |
| | | const matchedCategory = allAlgorithms.value.find(category => category.dict_key === typeValue) |
| | | |
| | | if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) { |
| | | algorithms2.value = [] |
| | | return |
| | |
| | | } |
| | | return colorMap[String(status)] || '' |
| | | } |
| | | |
| | | // 获取tab数据 |
| | | async function fetchTabCounts() { |
| | | const statusListVal = statusList.value; |
| | | const params = { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // tab切换 |
| | | function handleTabChange(tab) { |
| | | activeTab.value = tab.props?.name || tab.name |
| | | |
| | |
| | | fetchTableData() |
| | | fetchTabCounts() |
| | | } |
| | | // 清空 |
| | | function handleReset() { |
| | | dictKey.value = '' |
| | | Object.assign(filters, { |
| | |
| | | function handleKeyWords() { |
| | | router.replace({}) |
| | | } |
| | | |
| | | // 分页 |
| | | async function handleCurrentChange(val) { |
| | | page.currentPage = val |
| | | await nextTick() |
| | | await fetchTableData() |
| | | } |
| | | |
| | | async function sizeChange(val) { |
| | | page.pageSize = val |
| | | page.currentPage = 1 |
| | | await nextTick() |
| | | await fetchTableData() |
| | | } |
| | | |
| | | function handleAdd() { |
| | | editFormData.value = null |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | async function getStepInfoData(val) { |
| | | try { |
| | | const orderNum = val |
| | |
| | | } |
| | | return true |
| | | } catch (error) { |
| | | console.error('获取步骤信息失败:', error) |
| | | if (activeTab.value === 'myTickets') { |
| | | const statusArr = workType.value === 1 ? ['3', '4'] : fixedStatuses.value |
| | | stepInfos.value = statusArr.map(status => ({ |
| | |
| | | } |
| | | |
| | | async function handleViewDetail(row) { |
| | | console.log('row',row); |
| | | |
| | | currentIndex.value = tableData.value.findIndex(item => item.id === row.id) |
| | | workType.value = row.work_type !== undefined ? Number(row.work_type) : 0 |
| | | const detailData = { |
| | |
| | | job_name: row.job_name || '', |
| | | } |
| | | |
| | | await getStepInfoData(row.orderNumber) |
| | | await getStepInfoData(row.event_num) |
| | | currentDetail.value.status = row.status |
| | | |
| | | currentDetail.value = { |
| | |
| | | showQR: false, |
| | | latAndLon: _.round(detailData.location[0], 6) + ',' + _.round(detailData.location[1], 6), |
| | | } |
| | | console.log('currentDetail.value',currentDetail.value); |
| | | |
| | | detailVisible.value = true |
| | | handleTypeChange(currentDetail.value.type) |
| | | } |
| | |
| | | ] |
| | | |
| | | export_json_to_excel(headers, exportData, '工单数据') |
| | | console.log('数据导出成功') |
| | | } catch (error) { |
| | | console.error('导出失败:', error) |
| | | } finally { |
| | |
| | | const latitude = Number(item.latitude) || Number(item.location?.[1]) || 0 |
| | | |
| | | return { |
| | | 工单编号: item.orderNumber || item.event_num || '', |
| | | 工单名称: item.orderName || item.event_name || '', |
| | | 工单编号: item.event_num || '', |
| | | 工单名称: item.event_name || '', |
| | | 所属部门: item.department || item.dept_name || '', |
| | | 发起时间: item.startTime || item.create_time || '', |
| | | 关联算法: item.aiType || item.ai_types || '', |
| | | 关联算法: item.ai_types || '', |
| | | 工单内容: item.address || item.content || '', |
| | | 工单类型: types.value.find(t => t.value === (item.type || item.work_order_type_dict_key))?.label || '', |
| | | 经纬度: !isNaN(longitude) && !isNaN(latitude) |
| | |
| | | // 删除方法 |
| | | function handleDelete(row) { |
| | | |
| | | console.log('删除工单:', row) |
| | | } |
| | | |
| | | // 添加选择变化处理方法 |
| | |
| | | } |
| | | |
| | | // 在Vue 3中需要使用ElMessageBox.confirm |
| | | |
| | | const data = { |
| | | id: currentItem.id, |
| | | status: currentItem.status, |
| | | isPass: 0, |
| | | eventNum: currentItem.orderNumber, |
| | | eventNum: currentItem.event_num, |
| | | } |
| | | |
| | | const response = await flowEvent(data) |
| | | if (response.data.code === 0) { |
| | | console.log('工单审核通过') |
| | | |
| | | const newSelections = [...selections.value] |
| | | newSelections.splice(currentImageIndex.value - 1, 1) |
| | | |
| | |
| | | id: currentItem.id, |
| | | status: currentItem.status, |
| | | isPass: 1, |
| | | eventNum: currentItem.orderNumber, |
| | | eventName: currentItem.orderName, |
| | | eventNum: currentItem.event_num, |
| | | eventName: currentItem.event_name, |
| | | } |
| | | |
| | | const response = await flowEvent(data) |
| | | if (response.data.code === 0) { |
| | | console.log('工单审核不通过') |
| | | |
| | | const newSelections = [...selections.value] |
| | | newSelections.splice(currentImageIndex.value - 1, 1) |
| | | selections.value = newSelections |
| | |
| | | // 导出工单报表 |
| | | function exportTheTick(row) { |
| | | const params = { |
| | | num: row.orderNumber |
| | | num: row.event_num |
| | | } |
| | | exportTheTicket(params).then(res => { |
| | | const elink = document.createElement('a') |
| | | elink.download = row.orderName + '.docx' |
| | | elink.download = row.event_name + '.docx' |
| | | elink.style.display = 'none' |
| | | const blob = new Blob([res.data]) |
| | | elink.href = URL.createObjectURL(blob) |
| | |
| | | elink.click() |
| | | document.body.removeChild(elink) |
| | | }) |
| | | console.log('数据导出成功') |
| | | } |
| | | |
| | | // 生命周期 |