Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -43,4 +43,9 @@ export const getPqReportAllVersion = (params:any) => {
|
|||||||
//被检设备归档
|
//被检设备归档
|
||||||
export const documentedPqDev = (ids: string[]) => {
|
export const documentedPqDev = (ids: string[]) => {
|
||||||
return http.post(`/report/documented`, ids)
|
return http.post(`/report/documented`, ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
//上传报告到云端
|
||||||
|
export const uploadReportToCloud = (deviceIds: string[]) => {
|
||||||
|
return http.post(`/report/uploadReportToCloud`, deviceIds)
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
link
|
link
|
||||||
:icon='Download'
|
:icon='Download'
|
||||||
@click="openDrawer('报告下载', scope.row)"
|
@click="openDrawer('报告下载', scope.row)"
|
||||||
v-if='form.activeTabs === 3 && form.activeChildTabs === 0 && scope.row.reportState === 1'
|
v-if='form.activeTabs === 3 && form.activeChildTabs === 0 && (scope.row.reportState === 1 ||scope.row.reportState === 3)'
|
||||||
>报告下载
|
>报告下载
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
@@ -630,6 +630,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
return '已生成'
|
return '已生成'
|
||||||
} else if (scope.row.reportState === 2) {
|
} else if (scope.row.reportState === 2) {
|
||||||
return '未检'
|
return '未检'
|
||||||
|
}else if(scope.row.reportState === 3){
|
||||||
|
return '已上传'
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ const initScriptData = async () => {
|
|||||||
|
|
||||||
let response: any = await getBigTestItem({reCheckType: checkStore.reCheckType, planId: checkStore.plan.id, devIds: checkStore.devices.map(item => item.deviceId)})
|
let response: any = await getBigTestItem({reCheckType: checkStore.reCheckType, planId: checkStore.plan.id, devIds: checkStore.devices.map(item => item.deviceId)})
|
||||||
|
|
||||||
let temp = response.data.map(item => {
|
let temp = response.data.map((item: any) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
scriptName: item.scriptName
|
scriptName: item.scriptName
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')"
|
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')"
|
||||||
v-if='modeStore.currentMode === "比对式"'>导入
|
v-if='modeStore.currentMode === "比对式"'>导入
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type='primary' :icon='Upload' plain @click='uploadFile()' v-if='appSceneStore.currentScene === "1"'>报告上传</el-button>
|
||||||
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||||
@click='batchDelete(scope.selectedListIds)'>
|
@click='batchDelete(scope.selectedListIds)'>
|
||||||
删除
|
删除
|
||||||
@@ -28,6 +29,8 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</ProTable>
|
</ProTable>
|
||||||
@@ -38,7 +41,7 @@
|
|||||||
|
|
||||||
<script setup lang='tsx' name='useRole'>
|
<script setup lang='tsx' name='useRole'>
|
||||||
import TimeControl from '@/components/TimeControl/index.vue'
|
import TimeControl from '@/components/TimeControl/index.vue'
|
||||||
import {type Device} from '@/api/device/interface/device.ts'
|
import {type Device} from '@/api/device/interface/device'
|
||||||
import {useHandleData} from '@/hooks/useHandleData'
|
import {useHandleData} from '@/hooks/useHandleData'
|
||||||
import {useDownload} from '@/hooks/useDownload'
|
import {useDownload} from '@/hooks/useDownload'
|
||||||
import ProTable from '@/components/ProTable/index.vue'
|
import ProTable from '@/components/ProTable/index.vue'
|
||||||
@@ -47,8 +50,9 @@ import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/int
|
|||||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||||
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
||||||
import {useDictStore} from '@/stores/modules/dict'
|
import {useDictStore} from '@/stores/modules/dict'
|
||||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev,getPqDevById} from '@/api/device/device/index.ts'
|
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index'
|
||||||
import {ElMessageBox} from 'element-plus'
|
import {uploadReportToCloud} from '@/api/device/report/index'
|
||||||
|
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||||
import {onBeforeMount, reactive, ref} from 'vue'
|
import {onBeforeMount, reactive, ref} from 'vue'
|
||||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
||||||
|
|
||||||
@@ -93,7 +97,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
prop: 'devType',
|
prop: 'devType',
|
||||||
label: '设备类型',
|
label: '设备类型',
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'createDate',
|
prop: 'createDate',
|
||||||
@@ -200,7 +204,7 @@ const openDialog = async (titleType: string, row: Partial<Device.ResPqDev> = {})
|
|||||||
row = await getPqDevById(row)
|
row = await getPqDevById(row)
|
||||||
devicePopup.value?.open(titleType, row.data, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
devicePopup.value?.open(titleType, row.data, modeStore.currentMode, appSceneStore.currentScene, devTypeOptions.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -251,8 +255,42 @@ const importFile = async (pattern: string) => {
|
|||||||
getTableList: proTable.value?.getTableList,
|
getTableList: proTable.value?.getTableList,
|
||||||
}
|
}
|
||||||
deviceImportExcel.value?.acceptParams(params)
|
deviceImportExcel.value?.acceptParams(params)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 报告上传
|
||||||
|
const uploadFile = async () => {
|
||||||
|
const selectedRows = proTable.value?.selectedList || []
|
||||||
|
|
||||||
|
if (selectedRows.length === 0) {
|
||||||
|
// 没有选择设备,弹出确认框询问是否处理全部
|
||||||
|
ElMessageBox.confirm('未选择被检设备,是否对全部设备进行报告上传?', '提示', {
|
||||||
|
type: 'warning',
|
||||||
|
confirmButtonText: '全部上传',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
}).then(() => {
|
||||||
|
// 用户确认全部上传,传递空数组或特殊标识
|
||||||
|
handleReportUpload([])
|
||||||
|
}).catch(() => {
|
||||||
|
// 用户取消
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 有选择设备,使用选中的设备ID
|
||||||
|
const selectedIds = selectedRows.map(row => row.id)
|
||||||
|
handleReportUpload(selectedIds)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理报告上传
|
||||||
|
const handleReportUpload = async (deviceIds: string[]) => {
|
||||||
|
try {
|
||||||
|
await uploadReportToCloud(deviceIds)
|
||||||
|
ElMessage.success('报告上传成功')
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('报告上传失败')
|
||||||
|
console.error('报告上传错误:', error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(async () => {
|
onBeforeMount(async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user