技术监督 页面联调

This commit is contained in:
GGJ
2024-03-18 19:43:55 +08:00
parent 1b6b8c8777
commit da9fb74192
25 changed files with 1016 additions and 191 deletions

View File

@@ -4,32 +4,41 @@
<TableHeader area ref="TableHeaderRef">
<template #select>
<el-form-item label="终端名称">
<el-select v-model="tableStore.table.params.searchState" placeholder="请选择终端名称">
<el-option
v-for="item in uploadData"
:key="item.id"
:label="item.label"
:value="item.id"
></el-option>
</el-select>
<el-input
v-model="tableStore.table.params.name"
clearable
placeholder="请输入终端名称"
></el-input>
</el-form-item>
<el-form-item label="生产厂家">
<el-select v-model="tableStore.table.params.searchStat1e" placeholder="请选择生产厂家">
<el-select
v-model="tableStore.table.params.manufacture"
placeholder="请选择生产厂家"
multiple
collapse-tags
clearable
class="select"
>
<el-option
v-for="item in uploadData"
v-for="item in manufactorList"
:key="item.id"
:label="item.label"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="检测结果">
<el-select v-model="tableStore.table.params.searchState3" placeholder="请输入检测结果">
<el-select
v-model="tableStore.table.params.testResults"
placeholder="请选择检测结果"
clearable
class="select"
>
<el-option
v-for="item in uploadData"
v-for="item in testResultsList"
:key="item.id"
:label="item.label"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
@@ -40,14 +49,33 @@
<el-button icon="el-icon-Edit" type="primary">修改</el-button>
<el-button icon="el-icon-Delete" type="primary">删除</el-button>
<el-button icon="el-icon-Download" type="primary">导出</el-button>
<el-button icon="el-icon-Download" type="primary">下载模板</el-button>
<el-button icon="el-icon-Upload" type="primary">excel导入</el-button>
<el-button icon="el-icon-Download" type="primary" @click="Export">下载模板</el-button>
<!-- <el-button icon="el-icon-Upload" type="primary">excel导入</el-button> -->
<el-upload
ref="uploadRef"
action=""
accept=".xls"
:limit="1"
:on-change="choose"
:show-file-list="false"
:auto-upload="false"
>
<template #trigger>
<el-button
icon="el-icon-Upload"
type="primary"
style="margin-left: 12px; margin-right: 12px"
>
excel导入
</el-button>
</template>
</el-upload>
<el-button icon="el-icon-Upload" type="primary">上传原始报告</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
<newlyIncreased ref="addRef" />
<newlyIncreased ref="addRef" @onsubmit="tableStore.index()" />
</div>
</div>
</template>
@@ -58,21 +86,19 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import newlyIncreased from './add.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { mainHeight } from '@/utils/layout'
import { DownloadExport, reportDownload, batchTerminal } from '@/api/process-boot/terminal'
import { useDictData } from '@/stores/dictData'
import { addUse, updateUse, removeUse } from '@/api/advance-boot/bearingCapacity'
const dictData = useDictData()
const uploadData = [
const manufactorList = dictData.getBasicData('Dev_Manufacturers')
const testResultsList = [
{
id: 0,
label: '未上传'
name: '未展开'
},
{
id: 1,
label: '已上传'
name: '已展开'
}
]
@@ -82,7 +108,7 @@ const addRef = ref()
const ruleFormRef = ref()
const tableStore = new TableStore({
url: '/system-boot/area/areaSelect',
url: '/process-boot/process/pmsTerminalDetection/getTerminalPage',
publicHeight: 85,
method: 'POST',
column: [
@@ -91,7 +117,13 @@ const tableStore = new TableStore({
{ field: 'orgName', title: '所属单位' },
{ field: 'id', title: '终端编号' },
{ field: 'name', title: '终端名称' },
{ field: 'manufacture', title: '生产厂家' },
{
field: 'manufacture',
title: '生产厂家',
formatter(row: any) {
return manufactorList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{ field: 'installPlace', title: '安装位置' },
{ field: 'inspectionUnit', title: '送检单位' },
{ field: 'testResults', title: '检测结果' },
@@ -112,7 +144,9 @@ const tableStore = new TableStore({
disabled: row => {
return row.originalReport == null
},
click: row => {}
click: row => {
download(row, 0)
}
},
{
name: 'edit',
@@ -123,24 +157,20 @@ const tableStore = new TableStore({
disabled: row => {
return row.inspectionReport == null
},
click: row => {}
click: row => {
download(row, 1)
}
}
]
}
],
loadCallback: () => {
tableStore.table.data = [
{
status: 2
}
]
}
]
})
tableStore.table.params.searchState = ''
tableStore.table.params.searchValue = ''
tableStore.table.params.type = ''
tableStore.table.params.name = ''
tableStore.table.params.id = dictData.state.area[0].id
tableStore.table.params.testResults = ''
tableStore.table.params.manufacture = []
tableStore.table.params.type = 0
provide('tableStore', tableStore)
@@ -149,7 +179,47 @@ const add = () => {
title: '新增'
})
}
// 关闭弹窗查询
const onsubmit = () => {}
// 下载模版
const Export = () => {
DownloadExport().then(res => {
let blob = new Blob([res], {
type: 'application/vnd.ms-excel'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = '终端入网检测录入模板' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
})
}
// 下载报告
const download = (row: any, type: number) => {
reportDownload({
id: row.id,
type: type
}).then(res => {
let blob = new Blob([res], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8'
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = type == 1 ? row.inspectionName : row.originalName // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
})
}
// excel导入
const choose = (e: any) => {
batchTerminal(e.raw).then(res => {
console.log('🚀 ~ batchTerminal ~ res:', res)
})
}
onMounted(() => {
tableStore.index()
})