| | |
| | | <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-form-item prop="evalStartDate" label="评价开始时间"> |
| | | <el-form-item prop="startDate" label="评价开始时间"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="state.formData.evalStartDate" |
| | | v-model="state.formData.startDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | placeholder="选择日期" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="evalEndDate" label="评价结束时间"> |
| | | <el-form-item prop="endDate" label="评价结束时间"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="state.formData.evalEndDate" |
| | | v-model="state.formData.endDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | placeholder="选择日期" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="deliver" label="机构评价负责人"> |
| | | <el-form-item prop="auser.name" label="机构评价负责人"> |
| | | <el-input |
| | | v-model="state.formData.deliver" |
| | | v-model="state.formData.auser.name" |
| | | size="large" |
| | | placeholder="请选择机构评价负责人" |
| | | @focus="openExperts('机构评价负责人')" |
| | | > |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openExperts('机构评价负责人')"/> |
| | |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item prop="deliver" label="技术负责人"> |
| | | <el-input |
| | | v-model="state.formData.deliver" |
| | | size="large" |
| | | placeholder="请选择技术负责人" |
| | | > |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openExperts('技术负责人')"/> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <div style="display: flex;align-items: center">评价日程安排</div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.tableData" :border="true" style="margin: 20px 0"> |
| | | <el-table :data="state.formData.estimateSchedules" :border="true" style="margin: 20px 0"> |
| | | <el-table-column label="序号" width="60" align="center" type="index"></el-table-column> |
| | | <el-table-column label="评价日程安排" prop="content" header-align="center" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="开始时间" header-align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="评价日程安排" prop="name" align="center" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="开始时间" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结束时间" header-align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="结束时间" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <div style="display: flex;align-items: center">项目组成员<el-icon style="margin-left: 10px;margin-right: 4px"><InfoFilled /></el-icon><span style="font-size: 13px">金属、非金属矿及其他矿采选业:安全、机械、电气、采矿、通风、地质、水工结构</span></div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="openWorksDialog('add',{})" :disabled="projectType==='view' || isEnd">添加成员</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.planPersons" :border="true" style="margin: 20px 0"> |
| | | <el-table-column label="序号" width="60" align="center" type="index"></el-table-column> |
| | | <el-table-column label="评价组成员" prop="person.name" align="center" :show-overflow-tooltip="true"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.jobType === 2">{{ scope.row.person.name }} (组长)</span> |
| | | <span v-else>{{scope.row.person.name}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="专业能力/资格证书" prop="person.certificateNo" align="center" :show-overflow-tooltip="true"> |
| | | <template #default="scope"> |
| | | {{ getCertNo(scope.row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="专业能力" header-align="center" :show-overflow-tooltip="true"></el-table-column>--> |
| | | <el-table-column label="承担工作" prop="work" align="center" class-name="small-padding fixed-width"></el-table-column> |
| | | <el-table-column label="承诺后期前往现场勘验" prop="laterPromise" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | {{(scope.row.laterPromise==1 || scope.row.laterPromise==true)?'是':'否'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="未到现场勘验原因" prop="reason" align="center" class-name="small-padding fixed-width"></el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link @click="openWorksDialog('edit',scope.row)" :disabled="projectType==='view' || isEnd">修改</el-button> |
| | | <el-button link type="danger" @click="delMember(scope.row)" :disabled="projectType==='view' || isEnd">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <div style="display: flex;align-items: center">所需仪器设备</div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="openDeviceDialog('add',{})" :disabled="projectType==='view' || isEnd">添加设备</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.devices" :border="true" style="margin: 20px 0"> |
| | | <el-table-column label="序号" width="60" align="center" type="index"></el-table-column> |
| | | <el-table-column label="设备名称" prop="deviceName" align="center" class-name="small-padding fixed-width"/> |
| | | <el-table-column label="开始时间" prop="startDate" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | {{scope.row.startDate.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结束时间" prop="endDate" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | {{scope.row.endDate.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link @click="openDeviceDialog('edit',scope.row)" :disabled="projectType==='view' || isEnd">修改</el-button> |
| | | <el-button link type="danger" @click="delDeviceItem(scope.row)" :disabled="projectType==='view' || isEnd">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | <experts-list ref="expertsListRef" @getName="getSelected"></experts-list> |
| | | <works-dialog ref="worksRef" @getList="getWorksList" :workList="state.workList" :typeList="state.jobTypeList"></works-dialog> |
| | | <device-dialog ref="deviceRef" @getList="getDeviceList"></device-dialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | |
| | | import {defineEmits, onMounted, reactive, ref} from "vue" |
| | | import {ElMessage} from "element-plus" |
| | | import {defineEmits, defineProps, onMounted, reactive, ref} from "vue" |
| | | import {ElMessage, ElMessageBox} from "element-plus" |
| | | import {Search} from '@element-plus/icons-vue' |
| | | import {addRisk, editRisk, getRiskDetail} from "@/api/projectManage/riskAnalysis" |
| | | import {addRecord, editRecord, getDetail, getWorks, getDevice, delWorks, delDevice} from "@/api/projectManage/evaPlan" |
| | | import Cookies from "js-cookie" |
| | | import ExpertsList from "./expertsList" |
| | | import WorksDialog from './worksDialog' |
| | | import DeviceDialog from './deviceDialog' |
| | | const props = defineProps(['projectId']) |
| | | const emit = defineEmits(["getNextStatus"]) |
| | | |
| | | import { useRoute } from 'vue-router' |
| | | const route = useRoute() |
| | | const state = reactive({ |
| | | formData: { |
| | | project: { |
| | | id: '', |
| | | |
| | | id: null, |
| | | projectId: null, |
| | | auser: { |
| | | name: '' |
| | | }, |
| | | id: '' |
| | | auserId: null, |
| | | estimateSchedules: [ |
| | | { |
| | | id: null, |
| | | sort: 1, |
| | | name: '勘验准备', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 1, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 2, |
| | | name: '现场勘验', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 2, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 3, |
| | | name: '材料分析整理', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 3, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 4, |
| | | name: '评价报告编写', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 4, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 5, |
| | | name: '整改情况现场确认', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 5, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 6, |
| | | name: '整理评价报告', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 6, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 7, |
| | | name: '报告审核', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 7, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: null, |
| | | sort: 8, |
| | | name: '报告修改', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 8, |
| | | projectId: null |
| | | }, |
| | | ], |
| | | planPersons: [], |
| | | devices: [], |
| | | startDate: '', |
| | | endDate: '' |
| | | }, |
| | | projectId: null, |
| | | planPersons: [], |
| | | devices: [], |
| | | rules: { |
| | | "project.name": [{required: true, message: '请填写项目名称', trigger: 'blur'}], |
| | | riskCharacter: [{required: true, message: '请填写行业风险特性', trigger: 'blur'}], |
| | | "auser.name": [{required: true, message: '请填写机构评价负责人', trigger: 'change'}], |
| | | startDate: [{required: true, message: '请选择评价开始时间', trigger: 'blur'}], |
| | | endDate: [{required: true, message: '请选择评价结束时间', trigger: 'blur'}] |
| | | }, |
| | | tableData: [ |
| | | { |
| | | id: '1', |
| | | content: '勘验准备', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '2', |
| | | content: '现场勘验', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '3', |
| | | content: '材料分析整理', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '4', |
| | | content: '评价报告编写', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '5', |
| | | content: '整改情况现场确认', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '6', |
| | | content: '整理评价报告', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '7', |
| | | content: '报告审核', |
| | | status: 1 |
| | | }, |
| | | { |
| | | id: '8', |
| | | content: '报告修改', |
| | | status: 1 |
| | | }, |
| | | workList: [ |
| | | {value: '报告编制',label: '报告编制'}, |
| | | {value: '文字校对',label: '文字校对'}, |
| | | {value: '现场勘验',label: '现场勘验'}, |
| | | {value: '资料收集整理',label: '资料收集整理'} |
| | | ], |
| | | jobTypeList: [ |
| | | {value: 1,label: '普通人员'}, |
| | | {value: 2,label: '组长'}, |
| | | ] |
| | | }) |
| | | const props = { |
| | | expandTrigger: 'hover', |
| | | value: 'name', |
| | | label: 'name' |
| | | } |
| | | |
| | | const isAmin = ref(false) |
| | | const formRef = ref() |
| | | const expertsListRef = ref() |
| | | onMounted(() => { |
| | | const worksRef = ref() |
| | | const deviceRef = ref() |
| | | onMounted(async () => { |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | if(userInfo.identity === 0){ |
| | | isAmin.value = true; |
| | | isAmin.value = true |
| | | } |
| | | }); |
| | | if(props.projectId){ |
| | | await getWorksList(props.projectId) |
| | | await getDeviceList(props.projectId) |
| | | } |
| | | isEnd.value = Cookies.get('end') |
| | | projectType.value = route.query.type; |
| | | }) |
| | | |
| | | const projectType = ref(''); |
| | | const isEnd = ref('') |
| | | const riskOpen = async (type,val) => { |
| | | console.log("type",type,val) |
| | | state.formData.projectId = val |
| | | isEnd.value = Cookies.get('end') |
| | | state.projectId = val |
| | | projectType.value = route.query.type; |
| | | for(let i of state.formData.estimateSchedules){ |
| | | i.projectId = val |
| | | } |
| | | // await getWorksList(val) |
| | | // await getDeviceList(val) |
| | | if(type === 'detail' || type === 'edit' ){ |
| | | const res = await getRiskDetail({projectId: val}); |
| | | const res = await getDetail({projectId: val}) |
| | | if(res.code == 200){ |
| | | state.formData = res.data; |
| | | state.formData.project.business = parseInt(res.data.project.business); |
| | | state.formData.project.area = [res.data.project.province,res.data.project.city]; |
| | | state.tableData[0].status = res.data.isInBusiness ? 1 : 0; |
| | | state.tableData[1].status = res.data.isSatisfyNeed ? 1 : 0; |
| | | state.tableData[2].status = res.data.isNeedExpert ? 1 : 0; |
| | | state.tableData[3].status = res.data.isFinishReport ? 1 : 0; |
| | | state.tableData[4].status = res.data.isAcceptChargess ? 1 : 0; |
| | | state.tableData[5].status = res.data.isFeasibility ? 1 : 0; |
| | | state.formData = JSON.parse(JSON.stringify(res.data)) |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | |
| | | } |
| | | if(type === 'add'){ |
| | | const {id, ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | delete data.project.area; |
| | | delete data.project.id; |
| | | data.isInBusiness = state.tableData[0].status === 1; |
| | | data.isSatisfyNeed = state.tableData[1].status === 1; |
| | | data.isNeedExpert = state.tableData[2].status === 1; |
| | | data.isFinishReport = state.tableData[3].status === 1; |
| | | data.isAcceptChargess = state.tableData[4].status === 1; |
| | | data.isFeasibility = state.tableData[5].status === 1; |
| | | console.log('data', data) |
| | | const res = await addRisk(data); |
| | | console.log(data) |
| | | const res = await addRecord(data); |
| | | if (res.code == 200) { |
| | | ElMessage.success('保存成功') |
| | | formRef.value.clearValidate(); |
| | | emit('getNextStatus', res.data); |
| | | emit('getNextStatus', state.formData.projectId); |
| | | |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else if(type === 'clickEdit'){ |
| | | const { ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | delete data.project.area; |
| | | data.isInBusiness = state.tableData[0].status === 1; |
| | | data.isSatisfyNeed = state.tableData[1].status === 1; |
| | | data.isNeedExpert = state.tableData[2].status === 1; |
| | | data.isFinishReport = state.tableData[3].status === 1; |
| | | data.isAcceptChargess = state.tableData[4].status === 1; |
| | | data.isFeasibility = state.tableData[5].status === 1; |
| | | console.log('data', data) |
| | | const res = await editRisk(data); |
| | | const res = await editRecord(data); |
| | | if (res.code == 200) { |
| | | ElMessage.success('变更成功') |
| | | formRef.value.clearValidate(); |
| | |
| | | } |
| | | } |
| | | |
| | | const getWorksList = async (id) =>{ |
| | | const works = await getWorks({projectId: id ? id : props.projectId}) |
| | | if(works.code == 200){ |
| | | state.planPersons = works.data |
| | | }else { |
| | | ElMessage.warning(works.message) |
| | | } |
| | | } |
| | | |
| | | const getDeviceList = async (id) =>{ |
| | | const device = await getDevice({projectId: id ? id : props.projectId}) |
| | | if(device.code == 200){ |
| | | state.devices = device.data |
| | | }else { |
| | | ElMessage.warning(device.message) |
| | | } |
| | | } |
| | | |
| | | const getCertNo = (row)=>{ |
| | | const obj = JSON.parse(row.person.certificateNo) |
| | | const noArr = Object.values(obj) |
| | | return row.person.majorNames.map((item,index)=>{ |
| | | return item + '(' + noArr[index] + ')' |
| | | }).join(',') |
| | | } |
| | | |
| | | const openExperts = (type) =>{ |
| | | expertsListRef.value.openDialog(type) |
| | | } |
| | | |
| | | const getSelected = (type,obj)=>{ |
| | | if(type == '项目负责人'){ |
| | | state.formData.project.leader = obj.name |
| | | } |
| | | if(type == '任务下达人'){ |
| | | state.formData.deliver = obj.name |
| | | } |
| | | state.formData.auser.name = obj.name |
| | | state.formData.auserId = obj.id |
| | | } |
| | | |
| | | const openWorksDialog = (type,data)=>{ |
| | | worksRef.value.openDialog(type,data,props.projectId) |
| | | } |
| | | |
| | | const openDeviceDialog = (type,data)=>{ |
| | | deviceRef.value.openDialog(type,data,props.projectId) |
| | | } |
| | | |
| | | const delMember = (row)=>{ |
| | | ElMessageBox.confirm( |
| | | '确定删除此条数据?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delWorks(row.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getWorksList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const delDeviceItem = (row)=>{ |
| | | console.log(row,'row') |
| | | ElMessageBox.confirm( |
| | | '确定删除此条数据?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delDevice(row.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getDeviceList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | defineExpose({ |