<template>
|
<div class="home-container">
|
<div style="height: 100%">
|
<el-row class="homeCard">
|
<el-col :span="8" style="display:flex;align-items: center">
|
<div class="grid-content topInfo">
|
<el-input v-model="searchNo" placeholder="请输入作业证编号"></el-input>
|
</div>
|
</el-col>
|
<el-col :span="8" style="display:flex;align-items: center">
|
<div class="grid-content topInfo">
|
<el-select v-model="workType" placeholder="请选择作业类型">
|
<el-option
|
v-for="item in workTypeList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
/>
|
</el-select>
|
</div>
|
</el-col>
|
<el-button type="primary" @click="searchRecord">查询</el-button>
|
<el-button plain @click="clearSearch">重置</el-button>
|
</el-row>
|
<div class="homeCard">
|
<div class="main-card">
|
<el-table
|
:data="tableData"
|
ref="singleTableRef"
|
highlight-current-row
|
style="width: 100%"
|
@current-change="handleCurrentChange"
|
:header-cell-style="{background: '#fafafa'}"
|
>
|
<el-table-column type="index" label="序号" width="80"/>
|
<el-table-column property="workPermitNo" label="作业证编号"/>
|
<el-table-column property="workTypeDesc" label="作业类型"/>
|
</el-table>
|
<!-- <div class="pageBtn">-->
|
<!-- <el-pagination-->
|
<!-- v-model:currentPage="currentPage"-->
|
<!-- v-model:page-size="pageSize"-->
|
<!-- :page-sizes="[10, 15]"-->
|
<!-- small=false-->
|
<!-- background-->
|
<!-- layout="total, sizes, prev, pager, next, jumper"-->
|
<!-- :total="totalSize"-->
|
<!-- @size-change="handleSizeChange"-->
|
<!-- @current-change="handleCurrentChange"-->
|
<!-- />-->
|
<!-- </div>-->
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script lang="ts">
|
import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { initBackEndControlRoutes } from '/@/router/backEnd';
|
import {useUserInfo} from "/@/stores/userInfo";
|
import { Session } from '/@/utils/storage';
|
import { Search } from '@element-plus/icons-vue'
|
import { ElMessage,ElTable } from 'element-plus'
|
import type { FormInstance, FormRules } from 'element-plus'
|
import { workApplyApi } from '/@/api/specialWorkSystem/workApply';
|
import {workProcessApi} from "/@/api/specialWorkSystem/workProcess";
|
|
|
interface stateType {
|
workPermitNo: string
|
searchNo: string
|
workType: number
|
}
|
export default defineComponent({
|
name: 'permitNo',
|
components: {},
|
props:[],
|
setup() {
|
const userInfo = useUserInfo()
|
const { userInfos } = storeToRefs(userInfo);
|
const currentRow = ref()
|
const singleTableRef = ref<InstanceType<typeof ElTable>>()
|
const state = reactive<stateType>({
|
workPermitNo: '',
|
searchNo: '',
|
workType: null,
|
tableData: [],
|
workTypeList: [
|
{
|
label: "动火作业",
|
value: 1
|
},
|
{
|
label: "受限空间作业",
|
value: 2
|
},
|
{
|
label: "吊装作业",
|
value: 3
|
},
|
{
|
label: "动土作业",
|
value: 4
|
},
|
{
|
label: "断路作业",
|
value: 5
|
},
|
{
|
label: "高处作业",
|
value: 6
|
},
|
{
|
label: "临时用电作业",
|
value: 7
|
},
|
{
|
label: "盲板抽堵作业",
|
value: 8
|
}
|
]
|
});
|
const handleCurrentChange = (val: User | undefined) => {
|
currentRow.value = val
|
state.workPermitNo = currentRow.value.workPermitNo
|
}
|
// 获取作业编号列表
|
const getAllReport = async (data)=>{
|
const res = await workProcessApi().postReportList({workPermitNo: state.searchNo,workType: state.workType})
|
if (res.data.code === '200') {
|
state.tableData = JSON.parse(JSON.stringify(res.data.data))
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
// 关键词查询记录
|
const searchRecord = async () => {
|
if (state.searchNo == ''&& state.workType == null) {
|
ElMessage({
|
type: 'warning',
|
message: '请输入查询关键词'
|
});
|
} else {
|
getAllReport();
|
}
|
};
|
|
const clearSearch = async () => {
|
state.searchNo = '';
|
state.workType = null;
|
getAllReport();
|
};
|
// 页面载入时执行方法
|
onMounted(() => {
|
getAllReport()
|
});
|
|
// 折线图
|
const renderMenu = async (value: string) => {
|
Session.set('projectId',value)
|
userInfos.value.projectId = value
|
await initBackEndControlRoutes();
|
};
|
return {
|
renderMenu,
|
currentRow,
|
singleTableRef,
|
searchRecord,
|
clearSearch,
|
handleCurrentChange,
|
Search,
|
...toRefs(state),
|
};
|
},
|
});
|
</script>
|
|
<style scoped lang="scss">
|
.home-container {
|
height: 100%;
|
overflow: hidden;
|
position: relative;
|
.homeCard{
|
width: 100%;
|
padding: 20px;
|
box-sizing: border-box;
|
background: #fff;
|
border-radius: 4px;
|
margin-bottom: 20px;
|
}
|
.applyBtn{
|
width: 100%;
|
background: #fff;
|
padding-top: 15px;
|
z-index: 5;
|
box-shadow: 0 -3px 8px rgba(150,150,150,.1);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.el-row{
|
margin-bottom: 20px;
|
}
|
.el-row:last-child {
|
margin-bottom: 0;
|
}
|
.el-input{
|
width: 100% !important;
|
}
|
.el-date-editor::v-deep{
|
width: 100%;
|
}
|
.el-select{
|
width: 100%;
|
}
|
.el-cascader{
|
width: 100% !important;
|
}
|
}
|
</style>
|