| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <div style="display: flex;align-items: center">评价日程安排</div> |
| | | <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-row> |
| | | <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="name" 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%" |
| | |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="openWorksDialog('add',{})">添加成员</el-button> |
| | | <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" 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.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" 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"> |
| | | <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" 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"> |
| | | <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)">修改</el-button> |
| | | <el-button link type="danger" @click="delMember(scope.row)">删除</el-button> |
| | | <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-col> |
| | | <el-col :span="6"> |
| | | <div style="width: 100%;display: flex;justify-content: right"> |
| | | <el-button type="primary" icon="Plus" @click="openDeviceDialog('add',{})">添加设备</el-button> |
| | | <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" header-align="center" class-name="small-padding fixed-width"/> |
| | | <el-table-column label="开始时间" prop="startDate" header-align="center" class-name="small-padding fixed-width"> |
| | | <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" header-align="center" class-name="small-padding fixed-width"> |
| | | <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="操作" 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-button link @click="openDeviceDialog('edit',scope.row)">修改</el-button> |
| | | <el-button link type="danger" @click="delDeviceItem(scope.row)">删除</el-button> |
| | | <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> |
| | |
| | | import DeviceDialog from './deviceDialog' |
| | | const props = defineProps(['projectId']) |
| | | const emit = defineEmits(["getNextStatus"]) |
| | | |
| | | import { useRoute } from 'vue-router' |
| | | const route = useRoute() |
| | | const state = reactive({ |
| | | formData: { |
| | | id: null, |
| | |
| | | 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) => { |
| | | 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 |
| | | } |
| | |
| | | } |
| | | if(type === 'add'){ |
| | | const {id, ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | console.log(data) |
| | | |
| | | const params = Object.assign({}, state.formData.estimateSchedules); |
| | | let i = 0 |
| | | |
| | | for (const key in params) { |
| | | if ((params[key].startDate == '' || params[key].startDate == null ) && (params[key].endDate == '' || params[key].endDate == null)) { |
| | | delete params[key].startDate; |
| | | delete params[key].endDate; |
| | | i++ |
| | | } |
| | | |
| | | } |
| | | console.log('data',params) |
| | | const finData = Object.entries(params).map(([key, value]) => ({ |
| | | ...value, |
| | | })); |
| | | if(i == finData.length){ |
| | | ElMessage.warning("请选择至少一个的日程安排日期"); |
| | | return; |
| | | } |
| | | try { |
| | | finData.forEach(item =>{ |
| | | // debugger |
| | | console.log(item.endDate,'item.endDate') |
| | | if(item.startDate && (item.startDate !='' || item.startDate !=null)){ |
| | | if(item.endDate =='' || item.endDate ==null){ |
| | | ElMessage.warning("请完善涉及的日程安排结束日期"); |
| | | throw new Error('Loop stopped') |
| | | } |
| | | } |
| | | if(item.endDate && (item.endDate !='' || item.endDate !=null)){ |
| | | if(item.startDate =='' || item.startDate ==null){ |
| | | ElMessage.warning("请完善涉及的日程安排开始日期"); |
| | | throw new Error('Loop stopped') |
| | | } |
| | | } |
| | | }) |
| | | }catch (e) { |
| | | throw new Error(e) |
| | | } |
| | | |
| | | data.estimateSchedules = finData |
| | | |
| | | const res = await addRecord(data); |
| | | if (res.code == 200) { |
| | | ElMessage.success('保存成功') |
| | |
| | | } |
| | | }else if(type === 'clickEdit'){ |
| | | const { ...data} = JSON.parse(JSON.stringify(state.formData)) |
| | | const params = Object.assign({}, state.formData.estimateSchedules); |
| | | let i = 0 |
| | | for (const key in params) { |
| | | if (params[key].startDate == '' && params[key].endDate == '') { |
| | | delete params[key].startDate; |
| | | delete params[key].endDate; |
| | | i++; |
| | | } |
| | | } |
| | | const finData = Object.entries(params).map(([key, value]) => ({ |
| | | ...value, |
| | | })); |
| | | if(i == finData.length){ |
| | | ElMessage.warning("请选择至少一个的日程安排日期"); |
| | | return; |
| | | } |
| | | try { |
| | | finData.forEach(item =>{ |
| | | // debugger |
| | | console.log(item.endDate,'item.endDate') |
| | | if(item.startDate && (item.startDate !='' || item.startDate !=null)){ |
| | | if(item.endDate =='' || item.endDate ==null){ |
| | | ElMessage.warning("请完善涉及的日程安排结束日期"); |
| | | throw new Error('Loop stopped') |
| | | } |
| | | } |
| | | if(item.endDate && (item.endDate !='' || item.endDate !=null)){ |
| | | if(item.startDate =='' || item.startDate ==null){ |
| | | ElMessage.warning("请完善涉及的日程安排开始日期"); |
| | | |
| | | throw new Error('Loop stopped') |
| | | } |
| | | } |
| | | }) |
| | | }catch (e) { |
| | | throw new Error(e) |
| | | } |
| | | data.estimateSchedules = finData |
| | | const res = await editRecord(data); |
| | | if (res.code == 200) { |
| | | ElMessage.success('变更成功') |