<!-- 开箱验收管理详情 --> <script name="EquipmentResumeUnpackDetail" lang="ts" setup> import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import filePreview from '@/components/filePreview/index.vue' import { getInfo } from '@/api/equipment/resume/unpack' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const printFileName = ref('') // 文件名 const $route = useRoute() const $router = useRouter() const fromPage = ref('') // 来源页面 const getListRow = ref({}) // 列表页带来的数据 // --------------------------------------路由参数---------------------------------------------- // 从路由中获取页面类型参数 if ($route.params) { if ($route.params.id) { infoId.value = $route.params.id as string } } // -----------------------------------------按钮-------------------------------------------------- // 关闭新增页面的回调 const close = () => { $router.back() } // 导出word const exportWord = () => { ElMessage.info('敬请期待') } // 导出pdf const exportPdf = () => { ElMessage.info('敬请期待') } // 打印 const print = () => { ElMessage.info('敬请期待') } // 新增设备台账 const addEquipment = () => { getInfo({ id: infoId.value }).then((res) => { $router.push({ path: `/equipmentInfo/add/${infoId.value}`, query: { unpackRecordId: infoId.value, unpackRecordName: res.data.logName, // 开箱验收记录表名称 equipmentName: res.data.equipmentName, // 设备名称 equipmentNo: res.data.equipmentNo, // 设备编号 model: res.data.model, // 型号 manufacturer: res.data.manufacturer, // 生产厂家 manufactureNo: res.data.manufactureNo, // 出厂编号 }, }) }) } // -----------------------------------------钩子-------------------------------------------------- onMounted(() => { getListRow.value = $route.query.row as any console.log($router.options.history.state.back) if ((`${$router.options.history.state.back!}`).includes('/equipmentInfo/detail')) { // 从开箱验收的详情跳过来 fromPage.value = 'equipment' } }) </script> <template> <app-container> <detail-page v-loading="loading" title="开箱验收管理"> <template #btns> <el-button v-if="fromPage !== 'equipment'" type="primary" @click="addEquipment"> 新增设备台账 </el-button> <el-button v-if="fromPage !== 'equipment'" type="primary" @click="exportWord"> 导出word </el-button> <el-button v-if="fromPage !== 'equipment'" type="primary" @click="exportPdf"> 导出pdf </el-button> <el-button v-if="fromPage !== 'equipment'" type="primary" @click="print"> 打印 </el-button> <el-button type="info" @click="close"> 关闭 </el-button> </template> </detail-page> <!-- <file-preview :print-file-name="printFileName" /> --> <div style="text-align: center;margin-top: 50px;font-weight: 600;"> 敬请期待 </div> </app-container> </template> <style lang="scss" scoped> // 样式 </style>