|
@@ -27,6 +27,7 @@
|
|
|
<el-button v-else @click="handleSubmitNotApproval">提交</el-button>
|
|
<el-button v-else @click="handleSubmitNotApproval">提交</el-button>
|
|
|
<!-- <el-button type="primary" plain @click="handleEditSpreadRecord">编辑封面</el-button>-->
|
|
<!-- <el-button type="primary" plain @click="handleEditSpreadRecord">编辑封面</el-button>-->
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <el-button type="primary" plain @click="handleCopyReportNo">复制编号</el-button>
|
|
|
<el-button type="default" plain @click="handleCloseModal">取 消</el-button>
|
|
<el-button type="default" plain @click="handleCloseModal">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="operation-item" style="max-height: calc(100% / 2); overflow-y: auto" v-if="props.editInspectionplanParams.isSelfType">
|
|
<div class="operation-item" style="max-height: calc(100% / 2); overflow-y: auto" v-if="props.editInspectionplanParams.isSelfType">
|
|
@@ -113,7 +114,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="tsx" setup>
|
|
<script lang="tsx" setup>
|
|
|
import { BoilerTaskOrderApi } from '@/api/pressure2/boilertaskorder'
|
|
import { BoilerTaskOrderApi } from '@/api/pressure2/boilertaskorder'
|
|
|
-import {defineModel, PropType, ref} from 'vue'
|
|
|
|
|
|
|
+import {defineModel, PropType, ref, watch} from 'vue'
|
|
|
import VuePdfEmbed from 'vue-pdf-embed'
|
|
import VuePdfEmbed from 'vue-pdf-embed'
|
|
|
import EditInspectionplanReport from './EditInspectionplanReport.vue'
|
|
import EditInspectionplanReport from './EditInspectionplanReport.vue'
|
|
|
import { getPressureReportTemplatePDF } from '@/api/pressure/reportTemplate'
|
|
import { getPressureReportTemplatePDF } from '@/api/pressure/reportTemplate'
|
|
@@ -386,6 +387,49 @@ const handleCloseModal = () => {
|
|
|
visible.value = false
|
|
visible.value = false
|
|
|
emits('refresh')
|
|
emits('refresh')
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 复制编号
|
|
|
|
|
+const handleCopyReportNo = async () => {
|
|
|
|
|
+ const reportNo = props.inspectionplanDetail?.reportNo
|
|
|
|
|
+ if (!reportNo) {
|
|
|
|
|
+ ElMessage.warning('复制失败,检验方案编号不存在')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (navigator.clipboard && window.isSecureContext) {
|
|
|
|
|
+ await navigator.clipboard.writeText(reportNo)
|
|
|
|
|
+ ElMessage.success('复制成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ fallbackCopyText(reportNo)
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ console.error('复制出错:', err)
|
|
|
|
|
+ fallbackCopyText(reportNo)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function fallbackCopyText(text: string) {
|
|
|
|
|
+ const input = document.createElement('textarea')
|
|
|
|
|
+ input.value = text
|
|
|
|
|
+ input.style.position = 'fixed'
|
|
|
|
|
+ input.style.opacity = '0'
|
|
|
|
|
+ input.style.height = '1px'
|
|
|
|
|
+ input.style.width = '1px'
|
|
|
|
|
+ document.body.appendChild(input)
|
|
|
|
|
+ input.focus()
|
|
|
|
|
+ input.select()
|
|
|
|
|
+ try {
|
|
|
|
|
+ const success = document.execCommand('copy')
|
|
|
|
|
+ if (success) {
|
|
|
|
|
+ ElMessage.success('复制成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error('当前浏览器不支持复制功能,请手动复制')
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ ElMessage.error('复制失败,请手动复制')
|
|
|
|
|
+ }
|
|
|
|
|
+ document.body.removeChild(input)
|
|
|
|
|
+}
|
|
|
const pdfContentWidth = ref(0)
|
|
const pdfContentWidth = ref(0)
|
|
|
const wrapperContainerRef = ref<HTMLDivElement | null>(null)
|
|
const wrapperContainerRef = ref<HTMLDivElement | null>(null)
|
|
|
const handleWindowResize = debounce(() => {
|
|
const handleWindowResize = debounce(() => {
|