<template> <div class="water-analysis-page"> <el-table :data="tableDataList" v-loading="tableLoading" stripe max-height="500" > <el-table-column type="index" width="55" label="序号" align="center" /> <el-table-column :label="i.label" align="center" :prop="i.props" show-overflow-tooltip v-for="i in qualityRectificationCloum" > <template #default="{ row }" v-if="i.props == 'projectName'"> <span class="projectName"> {{ row.projectName }}</span> </template> <template #default="{ row }" v-if="i.props == 'reformNo'"> <span @click="onCheck(row, 4, '详情')" class="projectName"> {{ row.reformNo }}</span > </template> <template #default="{ row }" v-if="i.props == 'abarbeitungStartTime'"> {{ row.abarbeitungStartTime.substring(0, 10) }} </template> <template #default="{ row }" v-if="i.props == 'abarbeitungEndTime'"> {{ row.abarbeitungEndTime.substring(0, 10) }} </template> <template #default="{ row }" v-if="i.props == 'status'"> <span style="color: red" v-if="row.fromStatus">驳回</span> <dict-tag :options="quality_rectification_status" :value="row.status" /> </template> </el-table-column> <el-table-column fixed="right" label="操作" width="230" align="center"> <template #default="{ row }"> <el-button link type="primary" icon="View" @click="onCheck(row, 4, '详情')" >详情</el-button > <el-button v-if=" row.status == 'projectDeptReplay' && todoList.queryScope == 'todo' " icon="Edit" link type="success" @click="onCheck(row, 6, '处理')" >处理</el-button > <el-button icon="EditPen" v-if=" (row.status == 'startQualityImprovement' || row.status == 'start') && todoList.queryScope != 'done' & userName == row.createBy " link type="success" @click="onCheck(row, 3, '提交')" >提交</el-button > <el-button icon="Delete" v-if=" row.status == 'start' && todoList.queryScope == 'main' && userName == row.createBy " link type="danger" @click="onCheck(row, 8)" >删除</el-button > </template> </el-table-column> </el-table> <slot name="pagination"></slot> <el-dialog v-model="visible" :title="'质量整改' + tittle" :modal-append-to-body="false" :close-on-click-modal="false" width="90%" height="95%" > <tableDalgo ref="tableDalgoRef" v-if="visible" @onModalClose="onModalClose" :typeList="typeList" ></tableDalgo> <template #footer> <div class="dialog-footer"> <el-button v-if="tittle != '详情'" @click="open2" type="primary">{{ tittle }}</el-button> <el-button @click="closed">关闭</el-button> </div> </template> </el-dialog> </div> </template> <script setup> import { defineExpose } from "vue"; import { getInfo, projectInfoDelete, projectInfoGet, getInfoMamin, } from "@/api/qualityRectification"; import tableDalgo from "./tableDalgo.vue"; import { downloadBlob, formatDate, formatMonths } from "@/utils/projectTable"; import emgBox from "@/utils/ElMessageBox"; import { qualityRectificationCloum } from "@/utils/cloums"; const { proxy } = getCurrentInstance(); const { project_operation_pattern, unit_property, credit_line, quality_rectification_status, } = proxy.useDict( "project_operation_pattern", "unit_property", "credit_line", "quality_rectification_status" ); const queryParams=ref({ pageNum: 1, pageSize: 10, }) const userName = sessionStorage.getItem('userName') const visible = ref(false); const tableDataList = ref([]); const tableLoading = ref(false); const typeList = ref({}); const tableDalgoRef = ref(); const tittle = ref(""); const { todoList, getInfoList, tableData } = defineProps([ "todoList", "getInfoList", "tableData", ]); const onCheck = (row, v, t) => { tittle.value = t; if (v == 8) { emgBox(row.id, projectInfoDeleteM, "您确定删除吗?"); } else { projectInfoGet(row.id).then(({ code, data }) => { if (code == 200) { typeList.value = { ...data, type: v }; visible.value = true; } }); } }; //删除 const projectInfoDeleteM = async (id) => { let { code } = await projectInfoDelete(id); getInfoList(tableData); }; function onModalClose() { getInfoList(tableData); visible.value = false; } function closed() { console.log(tableDalgoRef.value, 99); tableDalgoRef.value.closed(); } function open2() { tableDalgoRef.value.submit(); } onMounted(() => { tableDataList.value = todoList; }); </script> <style lang="scss" scoped> .water-analysis-page { padding: 20px; height: 90vh; ::v-deep .el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active { font-size: 18px; color: rgb(255, 255, 255); background-color: rgb(22, 132, 252); border-left: 1px solid rgb(22, 132, 252); } } :deep(.el-dialog__body) { background-color: #eef1fb; height: 750px; overflow: auto; } </style>