调整检测计划导入、导出功能适应二楼装备
This commit is contained in:
@@ -63,17 +63,17 @@ export const getPlanListByPattern = (params: Plan.ReqPlan) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出检测计划
|
// 导出检测计划
|
||||||
export const exportPlan = (params: Device.ReqPqDevParams) => {
|
export const exportCNPlan = (params: Device.ReqPqDevParams) => {
|
||||||
return http.download(`/adPlan/export`, params)
|
return http.download(`/adPlan/exportCNPlan`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载模板
|
// 下载模板
|
||||||
export const downloadTemplate = () => {
|
export const downloadCNPlanTemplate = () => {
|
||||||
return http.download(`/adPlan/downloadTemplate`)
|
return http.download(`/adPlan/downloadCNPlanTemplate`)
|
||||||
}
|
}
|
||||||
// 导入检测计划
|
// 导入检测计划
|
||||||
export const importPlan = (params: Device.ReqPqDevParams) => {
|
export const importCNPlan = (params: Device.ReqPqDevParams) => {
|
||||||
return http.upload(`/adPlan/import`, params)
|
return http.uploadExcel(`/adPlan/importCNPlan`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 装置检测报告生成
|
// 装置检测报告生成
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ const uploadExcel = async (param: UploadRequestOptions) => {
|
|||||||
|
|
||||||
|
|
||||||
async function handleImportResponse(res: any) {
|
async function handleImportResponse(res: any) {
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
if (res.type === 'application/json') {
|
if (res.type === 'application/json') {
|
||||||
const fileReader = new FileReader()
|
const fileReader = new FileReader()
|
||||||
fileReader.onloadend = () => {
|
fileReader.onloadend = () => {
|
||||||
@@ -118,7 +120,7 @@ async function handleImportResponse(res: any) {
|
|||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
link.href = url
|
link.href = url
|
||||||
link.download = '终端入网检测失败列表'
|
link.download = '导入失败数据'
|
||||||
document.body.appendChild(link)
|
document.body.appendChild(link)
|
||||||
link.click()
|
link.click()
|
||||||
link.remove()
|
link.remove()
|
||||||
|
|||||||
@@ -320,10 +320,7 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
|
|
||||||
if (oldValue == 'error') {
|
if (oldValue == 'error') {
|
||||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!`})
|
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!`})
|
||||||
|
handleReCheck()
|
||||||
initCheckResult()
|
|
||||||
activeIndex = 0
|
|
||||||
percentage.value = 0
|
|
||||||
}
|
}
|
||||||
emit('update:testStatus', 'test_init')
|
emit('update:testStatus', 'test_init')
|
||||||
//startTimer() // todo 可移除
|
//startTimer() // todo 可移除
|
||||||
@@ -1334,11 +1331,17 @@ const handleResumeTest = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleReCheck = () => {
|
const handleReCheck = () => {
|
||||||
|
initCheckResult()
|
||||||
activeIndex = 0
|
activeIndex = 0
|
||||||
percentage.value = 0
|
percentage.value = 0
|
||||||
|
timeCount.value = 0
|
||||||
|
timeView.value = '00:00:00'
|
||||||
|
timeDifference.value = 0
|
||||||
testLogList.length = 0
|
testLogList.length = 0
|
||||||
errorCheckItem.length = 0
|
errorCheckItem.length = 0
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
|
showTestLog()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前执行的大测试项序号
|
// 获取当前执行的大测试项序号
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<TestSourcePopup :refresh-table='proTable?.getTableList' ref="testSourcePopup"/>
|
<TestSourcePopup :refresh-table='proTable?.getTableList' ref="testSourcePopup"/>
|
||||||
<!-- 查看设备绑定
|
<!-- 查看设备绑定
|
||||||
<DevTransfer :refresh-table='proTable?.getTableList' ref='devTransferPopup'/> -->
|
<DevTransfer :refresh-table='proTable?.getTableList' ref='devTransferPopup'/> -->
|
||||||
<ImportExcel ref='deviceImportExcel' />
|
<ImportExcel ref='planImportExcel' />
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
import ProTable from '@/components/ProTable/index.vue'
|
import ProTable from '@/components/ProTable/index.vue'
|
||||||
import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
||||||
import { ScaleToOriginal, CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue'
|
import { ScaleToOriginal, CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue'
|
||||||
import {getPlanList,deletePlan,exportPlan,downloadTemplate,importPlan } from '@/api/plan/plan.ts'
|
import {getPlanList,deletePlan,exportCNPlan,downloadCNPlanTemplate,importCNPlan } from '@/api/plan/plan.ts'
|
||||||
import { computed, onMounted, reactive, ref } from 'vue'
|
import { computed, onMounted, reactive, ref } from 'vue'
|
||||||
import type { Plan } from '@/api/plan/interface'
|
import type { Plan } from '@/api/plan/interface'
|
||||||
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
|
import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
|
||||||
@@ -66,7 +66,7 @@ import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
|||||||
import { useHandleData } from '@/hooks/useHandleData'
|
import { useHandleData } from '@/hooks/useHandleData'
|
||||||
import { dictTestState,dictReportState,dictResult } from '@/api/plan/planData.ts'
|
import { dictTestState,dictReportState,dictResult } from '@/api/plan/planData.ts'
|
||||||
import {getTestSourceById} from '@/api/device/testSource/index'
|
import {getTestSourceById} from '@/api/device/testSource/index'
|
||||||
import ImportExcel from "@/components/ImportExcel/index.vue";
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
||||||
import {useDownload} from "@/hooks/useDownload";
|
import {useDownload} from "@/hooks/useDownload";
|
||||||
import {getTestConfig } from '@/api/system/base/index'
|
import {getTestConfig } from '@/api/system/base/index'
|
||||||
import {type Base } from '@/api/system/base/interface'
|
import {type Base } from '@/api/system/base/interface'
|
||||||
@@ -88,7 +88,7 @@ const planPopup = ref()
|
|||||||
const devTransferPopup = ref()
|
const devTransferPopup = ref()
|
||||||
const modeStore = useModeStore();
|
const modeStore = useModeStore();
|
||||||
|
|
||||||
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
const planImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||||
|
|
||||||
const getTableList = async(params: any) => {
|
const getTableList = async(params: any) => {
|
||||||
let newParams = JSON.parse(JSON.stringify(params))
|
let newParams = JSON.parse(JSON.stringify(params))
|
||||||
@@ -336,21 +336,21 @@ function handleFiles(event: Event) {
|
|||||||
// 点击导入按钮
|
// 点击导入按钮
|
||||||
const importClick = () => {
|
const importClick = () => {
|
||||||
const params = {
|
const params = {
|
||||||
title: '被检设备',
|
title: '检测计划',
|
||||||
showCover: false,
|
showCover: false,
|
||||||
patternId: dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id ?? '',
|
patternId: dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id ?? '',
|
||||||
tempApi: downloadTemplate,
|
tempApi: downloadCNPlanTemplate,
|
||||||
importApi: importPlan,
|
importApi: importCNPlan,
|
||||||
getTableList: proTable.value?.getTableList,
|
getTableList: proTable.value?.getTableList,
|
||||||
}
|
}
|
||||||
deviceImportExcel.value?.acceptParams(params)
|
planImportExcel.value?.acceptParams(params)
|
||||||
}
|
}
|
||||||
// 点击导出按钮
|
// 点击导出按钮
|
||||||
const exportClick = () => {
|
const exportClick = () => {
|
||||||
|
|
||||||
ElMessageBox.confirm('确认导出检测计划?', '温馨提示', { type: 'warning' }).then(() =>{
|
ElMessageBox.confirm('确认导出检测计划?', '温馨提示', { type: 'warning' }).then(() =>{
|
||||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
|
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||||
useDownload(exportPlan,'检测计划导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
|
useDownload(exportCNPlan,'检测计划导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user