| | |
| | | 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-col>--> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="openExperts('项目组成员')">添加成员</el-button> |
| | | <el-button type="primary" icon="Plus" @click="openWorksDialog('add',{})">添加成员</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.formData.planPersons" :border="true" style="margin: 20px 0"> |
| | | <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" header-align="center" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="资格证书" prop="person.certificateNo" header-align="center" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="专业能力" prop="person.major" 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="person.certificateNo" header-align="center" :show-overflow-tooltip="true"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row.work" multiple placeholder="承担工作" style="width: 100%" size="large"> |
| | | <el-option v-for="item in state.workList" :key="item.value" :label="item.label" :value="item.value"/> |
| | | </el-select> |
| | | {{ getCertNo(scope.row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="承诺后期前往现场勘验" header-align="center" class-name="small-padding fixed-width"> |
| | | <!-- <el-table-column label="专业能力" header-align="center" :show-overflow-tooltip="true"></el-table-column>--> |
| | | <el-table-column label="承担工作" prop="work" header-align="center" class-name="small-padding fixed-width"></el-table-column> |
| | | <el-table-column label="承诺后期前往现场勘验" prop="laterPromise" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="scope.row.laterPromise" size="large"> |
| | | <el-radio :label="1" size="large">是</el-radio> |
| | | <el-radio :label="0" size="large">否</el-radio> |
| | | </el-radio-group> |
| | | {{(scope.row.laterPromise==1 || scope.row.laterPromise==true)?'是':'否'}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="未到现场勘验原因" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.reason" maxlength="30" show-word-limit type="text" size="large"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="未到现场勘验原因" prop="reason" header-align="center" class-name="small-padding fixed-width"></el-table-column> |
| | | <el-table-column label="操作" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="danger" @click="delMember(scope.$index)">删除</el-button> |
| | | <el-button link @click="openWorksDialog('edit',scope.row)">修改</el-button> |
| | | <el-button link type="danger" @click="delMember(scope.row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="addDevice">添加设备</el-button> |
| | | <el-button type="primary" icon="Plus" @click="openDeviceDialog('add',{})">添加设备</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.formData.devices" :border="true" style="margin: 20px 0"> |
| | | <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="设备名称" header-align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="设备名称" prop="deviceName" header-align="center" class-name="small-padding fixed-width"/> |
| | | <el-table-column label="开始时间" prop="startDate" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-input v-model="scope.row.deviceName" maxlength="30" show-word-limit type="text" size="large"/> |
| | | {{scope.row.startDate.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="开始时间" header-align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="结束时间" prop="endDate" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="scope.row.startDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | placeholder="选择日期" |
| | | size="large" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="结束时间" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | v-model="scope.row.endDate" |
| | | type="date" |
| | | value-format="YYYY-MM-DD 00:00:00" |
| | | placeholder="选择日期" |
| | | size="large" |
| | | /> |
| | | {{scope.row.endDate.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" header-align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="danger" @click="delDevice(scope.$index)">删除</el-button> |
| | | <el-button link @click="openDeviceDialog('edit',scope.row)">修改</el-button> |
| | | <el-button link type="danger" @click="delDeviceItem(scope.row)">删除</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"]) |
| | | |
| | | const state = reactive({ |
| | | formData: { |
| | | id: null, |
| | | projectId: null, |
| | | auser: { |
| | | name: '' |
| | |
| | | estimateSchedules: [ |
| | | { |
| | | id: 1, |
| | | sort: 1, |
| | | name: '勘验准备', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 1 |
| | | scheduleType: 1, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 2, |
| | | sort: 2, |
| | | name: '现场勘验', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 2 |
| | | scheduleType: 2, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 3, |
| | | sort: 3, |
| | | name: '材料分析整理', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 3 |
| | | scheduleType: 3, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 4, |
| | | sort: 4, |
| | | name: '评价报告编写', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 4 |
| | | scheduleType: 4, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 5, |
| | | sort: 5, |
| | | name: '整改情况现场确认', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 5 |
| | | scheduleType: 5, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 6, |
| | | sort: 6, |
| | | name: '整理评价报告', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 6 |
| | | scheduleType: 6, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 7, |
| | | sort: 7, |
| | | name: '报告审核', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 7 |
| | | scheduleType: 7, |
| | | projectId: null |
| | | }, |
| | | { |
| | | id: 8, |
| | | sort: 8, |
| | | name: '报告修改', |
| | | startDate: '', |
| | | endDate: '', |
| | | scheduleType: 8 |
| | | scheduleType: 8, |
| | | projectId: null |
| | | }, |
| | | ], |
| | | planPersons: [], |
| | | devices: [], |
| | | startDate: '', |
| | | endDate: '', |
| | | id: '' |
| | | endDate: '' |
| | | }, |
| | | projectId: null, |
| | | planPersons: [], |
| | | devices: [], |
| | | rules: { |
| | | "auser.name": [{required: true, message: '请填写机构评价负责人', trigger: 'blur'}], |
| | | "auser.name": [{required: true, message: '请填写机构评价负责人', trigger: 'change'}], |
| | | startDate: [{required: true, message: '请选择评价开始时间', trigger: 'blur'}], |
| | | endDate: [{required: true, message: '请选择评价结束时间', trigger: 'blur'}] |
| | | }, |
| | |
| | | {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() |
| | | const worksRef = ref() |
| | | const deviceRef = ref() |
| | | onMounted(() => { |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | if(userInfo.identity === 0){ |
| | | isAmin.value = true; |
| | | isAmin.value = true |
| | | } |
| | | }); |
| | | }) |
| | | |
| | | const riskOpen = async (type,val) => { |
| | | console.log("type",type,val) |
| | | state.formData.projectId = val |
| | | state.projectId = val |
| | | 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.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; |
| | | 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(); |
| | |
| | | } |
| | | }else if(type === 'clickEdit'){ |
| | | const { ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | delete data.project.area; |
| | | 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.auser.name = obj.name |
| | | state.formData.auserId = obj.id |
| | | }else{ |
| | | let member = { |
| | | person: { |
| | | name: obj.name, |
| | | certificateNo: obj.certificateNo?obj.certificateNo:'', |
| | | major: obj.speciality, |
| | | }, |
| | | informed: 0, |
| | | work: '', |
| | | laterPromise: 0, |
| | | reason: '' |
| | | } |
| | | state.formData.planPersons.push(member) |
| | | } |
| | | state.formData.auser.name = obj.name |
| | | state.formData.auserId = obj.id |
| | | } |
| | | |
| | | const delMember = (index)=>{ |
| | | state.formData.planPersons.splice(index,1) |
| | | const openWorksDialog = (type,data)=>{ |
| | | worksRef.value.openDialog(type,data,props.projectId) |
| | | } |
| | | |
| | | const addDevice = ()=>{ |
| | | let device = { |
| | | projectId: null, |
| | | deviceName: '', |
| | | startDate: '', |
| | | endDate: '' |
| | | } |
| | | state.formData.devices.push(device) |
| | | const openDeviceDialog = (type,data)=>{ |
| | | deviceRef.value.openDialog(type,data,props.projectId) |
| | | } |
| | | |
| | | const delDevice = (index)=>{ |
| | | state.formData.devices.splice(index,1) |
| | | 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({ |