绘制 普测计划页面
This commit is contained in:
@@ -68,8 +68,8 @@
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<!-- 上传检测报告 -->
|
||||
<el-dialog
|
||||
<!-- 上传检测报告 -->
|
||||
<el-dialog
|
||||
title="上传检测报告__支持批量上传"
|
||||
v-model="showBatchUpload"
|
||||
width="30%"
|
||||
@@ -83,11 +83,13 @@
|
||||
accept=".doc,.docx"
|
||||
:file-list="fileList"
|
||||
:on-remove="handleRemove"
|
||||
:on-change="chooseBatch"
|
||||
:on-change="chooseBatch"
|
||||
ref="upload"
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-Upload">选择文件</el-button>
|
||||
<span :style="`color:#f58003`"> (*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))</span>
|
||||
<span :style="`color:#f58003`">
|
||||
(*传入的检测报告文件格式(终端编号-检测报告(yyyy-MM-dd).docx))
|
||||
</span>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
@@ -103,7 +105,7 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { DownloadExport, reportDownload, batchTerminal, delTerminal ,importReport} from '@/api/process-boot/terminal'
|
||||
import { DownloadExport, reportDownload, batchTerminal, importReport } from '@/api/process-boot/terminal'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
|
||||
const dictData = useDictData()
|
||||
@@ -121,7 +123,6 @@ const testResultsList = [
|
||||
|
||||
const TableHeaderRef = ref()
|
||||
const showBatchUpload = ref(false)
|
||||
const ruleFormRef = ref()
|
||||
const fileList: any = ref([])
|
||||
const tableStore = new TableStore({
|
||||
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
|
||||
@@ -138,7 +139,13 @@ const tableStore = new TableStore({
|
||||
},
|
||||
{ field: 'installPlace', title: '安装位置' },
|
||||
{ field: 'inspectionUnit', title: '送检单位' },
|
||||
{ field: 'testResults', title: '检测结果' },
|
||||
{
|
||||
field: 'testResults',
|
||||
title: '检测结果',
|
||||
formatter(row: any) {
|
||||
return row.cellValue == 0 ? '未展开' : '已展开'
|
||||
}
|
||||
},
|
||||
{ field: 'nextInspectionTime', title: '下次检测时间' },
|
||||
{
|
||||
title: '操作',
|
||||
@@ -146,32 +153,6 @@ const tableStore = new TableStore({
|
||||
render: 'buttons',
|
||||
fixed: 'right',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '编辑',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {}
|
||||
},
|
||||
{
|
||||
title: '删除',
|
||||
type: 'danger',
|
||||
icon: 'el-icon-Delete',
|
||||
render: 'confirmButton',
|
||||
popconfirm: {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
confirmButtonType: 'danger',
|
||||
title: '确定删除吗?'
|
||||
},
|
||||
click: row => {
|
||||
delTerminal([row.id]).then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
tableStore.index()
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
title: '下载原始数据报告',
|
||||
@@ -215,7 +196,7 @@ provide('tableStore', tableStore)
|
||||
const onsubmit = () => {}
|
||||
// 下载模版
|
||||
const Export = () => {
|
||||
DownloadExport().then(res => {
|
||||
DownloadExport().then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.ms-excel'
|
||||
})
|
||||
@@ -233,7 +214,7 @@ const download = (row: any, type: number) => {
|
||||
reportDownload({
|
||||
id: row.id,
|
||||
type: type
|
||||
}).then(res => {
|
||||
}).then((res: any) => {
|
||||
let blob = new Blob([res], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
|
||||
})
|
||||
@@ -273,12 +254,12 @@ const UploadOriginal = () => {
|
||||
// 上传
|
||||
const BatchUpload = () => {
|
||||
let form = new FormData()
|
||||
form.append('type', 1)
|
||||
fileList.value.forEach(item => {
|
||||
form.append('type', '1')
|
||||
fileList.value.forEach((item: any) => {
|
||||
form.append('files', item.raw)
|
||||
})
|
||||
importReport(form)
|
||||
.then(res => {
|
||||
.then((res: any) => {
|
||||
if (res.type == 'application/json') {
|
||||
ElMessage.success('上传成功!')
|
||||
handleClose()
|
||||
@@ -296,7 +277,7 @@ const chooseBatch = (e: any) => {
|
||||
fileList.value.push(e)
|
||||
}
|
||||
const handleRemove = (e: any) => {
|
||||
fileList.value = fileList.value.filter(item => item.uid !== e.uid)
|
||||
fileList.value = fileList.value.filter((item: any) => item.uid !== e.uid)
|
||||
}
|
||||
const handleClose = () => {
|
||||
fileList.value = []
|
||||
|
||||
Reference in New Issue
Block a user