冀北项目添加表格导出功能 技术监督添加下载模版上传功能

This commit is contained in:
GGJ
2025-03-28 16:05:03 +08:00
parent 76f41e9a24
commit ef04022f14
153 changed files with 4208 additions and 3480 deletions

View File

@@ -1,28 +1,36 @@
<template>
<TableHeader area datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<TableHeader area datePicker nextFlag theCurrentTime showTimeAll ref="TableHeaderRef" showExport>
<template v-slot:select>
<el-form-item label='监督类型'>
<el-select v-model='tableStore.table.params.supvType' clearable placeholder='请选择监督类型'>
<el-option v-for='item in supvTypeOptionList' :key='item.id' :label='item.name'
:value='item.id'></el-option>
<el-form-item label="监督类型">
<el-select v-model="tableStore.table.params.supvType" clearable placeholder="请选择监督类型">
<el-option
v-for="item in supvTypeOptionList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label='流程状态'>
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择流程状态'>
<el-option v-for='item in statusSelect' :key='item.id' :label='item.name'
:value='item.id'></el-option>
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig' />
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<planTest ref='planTestRef' @onsubmit='tableStore.index()' />
<planTest ref="planTestRef" @onsubmit="tableStore.index()" />
</template>
<script setup lang='ts'>
<script setup lang="ts">
import { ref, onMounted, provide, watch, nextTick } from 'vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
@@ -54,6 +62,7 @@ const tableStore = new TableStore({
url: '/supervision-boot/surveyTest/surveyTestPage',
publicHeight: 65,
method: 'POST',
filename: '技术监督测试管理',
column: [
{
width: '60',
@@ -213,6 +222,22 @@ const tableStore = new TableStore({
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
},
exportProcessingData: () => {
tableStore.table.allData = tableStore.table.allData.filter(item => {
item.problemFlag = item.problemFlag == 0 ? '合格' : item.problemFlag == 1 ? '存在问题' : '待测试'
item.status =
item.status == 0
? '待提交审批'
: item.status == 1
? '审批中'
: item.status == 2
? '审批通过'
: item.status == 3
? '审批不通过'
: '已取消'
return item
})
}
})
@@ -239,25 +264,19 @@ const deleteEven = () => {
message: '请选择要删除的数据'
})
} else {
ElMessageBox.confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
}).then(() => {
deleteSurveyPlanTest(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
})
}
}
const exportFn = () => {
@@ -320,20 +339,24 @@ onMounted(() => {
})
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
}, { immediate: true })
watch(
() => props.id,
async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
nextTick(() => {
if (props.businessKey == '3') {
planTestRef.value.open('编辑', fullId, false)
} else {
planTestRef.value.open('重新发起计划测试', fullId, false)
}
})
},
{ immediate: true }
)
</script>
<style scoped lang='scss'></style>
<style scoped lang="scss"></style>