| | |
| | | <el-form ref="formRef" :model="state.formData" :rules="state.rules" class="register-form" label-position="top"> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="6"> |
| | | <el-button type="primary" @click="addRectify('add',{})">新增整改</el-button> |
| | | <el-button type="primary" @click="addRectify('add',{})" :disabled="projectType ==='view' || isEnd ">新增整改</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.recitificationList" :border="true" style="margin: 20px 0"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="addRectify('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="danger" @click="del(scope.row)">删除</el-button> |
| | | <el-button link type="primary" @click="addRectify('edit',scope.row)" :disabled="projectType ==='view' || isEnd ">编辑</el-button> |
| | | <el-button link type="danger" @click="del(scope.row)" :disabled="projectType ==='view' || isEnd ">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | <confirm-end-dialog ref="confirmRef" @getList="getList"></confirm-end-dialog> |
| | | <confirm-end-dialog ref="confirmRef" @getList="getList(props.projectId)"></confirm-end-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | <script setup> |
| | | |
| | | import {defineEmits, onMounted, reactive, ref} from "vue"; |
| | | import {defineEmits, defineProps, onMounted, reactive, ref} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {addRecord, editRecord, getDetail} from "@/api/projectManage/contractMng"; |
| | | import Cookies from "js-cookie"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import confirmEndDialog from './confirmEndDialog.vue' |
| | | import {delProject, getAccessoryFile} from "@/api/projectManage/project"; |
| | | import {delProject, getAccessoryFile, getProjectStatus} from "@/api/projectManage/project"; |
| | | import {delRecitification, doConfirm, getRecognitionList} from "@/api/projectManage/riskAnalysis"; |
| | | import axios from "axios"; |
| | | |
| | | import { useRoute } from 'vue-router' |
| | | const route = useRoute() |
| | | const confirmRef = ref(null); |
| | | const emit = defineEmits(["getNextStatus"]); |
| | | const props = defineProps(['projectId']) |
| | | const state = reactive({ |
| | | formData: {}, |
| | | queryParams: { |
| | |
| | | recitificationList: [], |
| | | }) |
| | | |
| | | const isEnd = ref(false) |
| | | const total = ref(0); |
| | | const isAmin = ref(false) |
| | | const formRef = ref(); |
| | |
| | | if(userInfo.identity === 0){ |
| | | isAmin.value = true; |
| | | } |
| | | if(Cookies.get('projectId')){ |
| | | state.formData.projectId = Cookies.get('projectId'); |
| | | if(props.projectId){ |
| | | state.formData.projectId = props.projectId; |
| | | getList(state.formData.projectId); |
| | | getStatus(state.formData.projectId); |
| | | } |
| | | // getList(); |
| | | isEnd.value = Cookies.get('end') |
| | | projectType.value = route.query.type; |
| | | |
| | | |
| | | }); |
| | | const getStatus = async (projectId) => { |
| | | const res = await getProjectStatus(projectId); |
| | | if(res.code == 200){ |
| | | if(res.data === 14){ |
| | | isEnd.value = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const getList = async (val) => { |
| | |
| | | } |
| | | } |
| | | |
| | | const projectType = ref('') |
| | | |
| | | const riskOpen = async (type,val) => { |
| | | await getList(val); |
| | | // await getList(val); |
| | | projectType.value = route.query.type; |
| | | state.formData.projectId = val; |
| | | |
| | | if(type === 'confirm') { |
| | | const res = await doConfirm({projectId: val}); |
| | | if (res.code == 200) { |
| | | ElMessage.success('保存成功') |
| | | Cookies.set('end',true) |
| | | isEnd.value = true; |
| | | formRef.value.clearValidate(); |
| | | emit('getNextStatus', state.formData.projectId); |
| | | } else { |
| | |
| | | const handleSizeChange = (val) => { |
| | | state.queryParams.pageNum = 1; |
| | | state.queryParams.pageSize = val |
| | | getList() |
| | | getList(props.projectId) |
| | | } |
| | | const handleCurrentChange = (val) => { |
| | | state.queryParams.pageNum = val |
| | | getList() |
| | | getList(props.projectId) |
| | | } |
| | | |
| | | // 图片上传 |
| | |
| | | const res = await delRecitification(val) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | getList() |
| | | getList(props.projectId) |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |