|
|
|
|
@ -98,7 +98,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="巡检配置"> |
|
|
|
|
<el-table :data="tableData" border style="width: 100%"> |
|
|
|
|
<el-table :data="tableData" border style="width: 98%"> |
|
|
|
|
<el-table-column prop="deviceId" align="center" label="专业名称"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select placeholder="请选择设备" disabled v-model="scope.row.deviceId" @change="((val) =>{changeDevice(val,scope.$index)})"> |
|
|
|
|
@ -116,54 +116,37 @@ |
|
|
|
|
<el-input placeholder="请输入工艺要求" v-model="scope.row.craft" disabled></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="period" align="center" label="巡检周期"> |
|
|
|
|
<el-table-column prop="period" align="center" label="巡检周期" v-if="addForm.taskStatus < 3"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select placeholder="请选择巡检周期" v-model="scope.row.period" disabled> |
|
|
|
|
<el-option v-for="item in periodArr" :key="item.dictKey" :label="item.dictValue" :value="parseInt(item.dictKey)"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="startTime" align="center" label="开始时间"> |
|
|
|
|
<el-table-column prop="startTime" align="center" label="开始时间" v-if="addForm.taskStatus < 3"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-date-picker style="width: 100%;" v-model="scope.row.startTime" type="date" |
|
|
|
|
placeholder="请选择开始时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd" disabled> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<!-- <el-table :data="addForm.inspectionData && addForm.inspectionData.find(item => item.floorName == activeFloorName).details.find(item1 => item1.deptName == activeRoomName).details" border style="width: 100%"> |
|
|
|
|
<el-table-column prop="deviceId" align="center" label="专业名称"> |
|
|
|
|
<el-table-column prop="startTime" align="center" label="状态" v-if="addForm.taskStatus >= 3"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select placeholder="请选择设备" disabled v-model="scope.row.deviceId" @change="((val) =>{changeDevice(val,scope.$index)})"> |
|
|
|
|
<el-option v-for="item in deviceList" :disabled="item.disabled" :key="item.id" :label="item.name" :value="item.id"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="checkContent" align="center" label="巡检内容"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入巡检内容" v-model="scope.row.checkContent" disabled></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="craft" align="center" label="工艺要求"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入工艺要求" v-model="scope.row.craft" disabled></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="period" align="center" label="巡检周期"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-select placeholder="请选择巡检周期" v-model="scope.row.period" disabled> |
|
|
|
|
<el-option v-for="item in periodArr" :key="item.dictKey" :label="item.dictValue" :value="parseInt(item.dictKey)"></el-option> |
|
|
|
|
</el-select> |
|
|
|
|
{{ scope.row.status == 0 ? '正常' : '异常' }} |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="startTime" align="center" label="开始时间"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-date-picker style="width: 100%;" v-model="scope.row.startTime" type="date" |
|
|
|
|
placeholder="请选择开始时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd" disabled> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<el-table-column prop="startTime" align="center" label="现场照片" v-if="addForm.taskStatus >= 3"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.picUrl != ''"> |
|
|
|
|
<img :src="scope.row.picUrl" alt="" style="width: 200px;height: 200px;"> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> --> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="使用人签字" prop="signUrl" v-if="addForm.taskStatus >= 3"> |
|
|
|
|
<el-input placeholder="请输入使用人签字" v-model="addForm.signUrl" disabled style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="备注" prop="remark" v-if="addForm.taskStatus >= 3"> |
|
|
|
|
<el-input placeholder="请输入备注" type="textarea" v-model="addForm.remark" disabled style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
@ -199,7 +182,7 @@ |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item label="预约上门时间" prop="appointTime"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看'" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%;" v-model="addForm.appointTime" type="date" placeholder="请选择预约上门时间"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看'" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 98%;" v-model="addForm.appointTime" type="date" placeholder="请选择预约上门时间"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
@ -218,7 +201,7 @@ |
|
|
|
|
:append-to-body="true" |
|
|
|
|
width="70%"> |
|
|
|
|
<div style="height: 500px; overflow: auto"> |
|
|
|
|
<el-form ref="inspectionForm" :model="inspectionForm" :rules="addRules" label-width="120px" label-position="left"> |
|
|
|
|
<el-form ref="inspectionForm" :model="inspectionForm" :rules="inspectionRules" label-width="120px" label-position="left"> |
|
|
|
|
<div> |
|
|
|
|
<div |
|
|
|
|
style=" |
|
|
|
|
@ -231,7 +214,7 @@ |
|
|
|
|
基本信息 |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="单位名称" prop="deptName"> |
|
|
|
|
<el-input placeholder="请输入单位名称" v-model="inspectionForm.deptName" disabled></el-input> |
|
|
|
|
<el-input placeholder="请输入单位名称" v-model="inspectionForm.deptName" disabled style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- <el-form-item label="巡检项目名称" prop="inspectionName"> |
|
|
|
|
<el-input placeholder="请输入巡检项目名称" v-model="inspectionForm.inspectionName" readonly></el-input> |
|
|
|
|
@ -252,14 +235,14 @@ |
|
|
|
|
巡检配置 |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="巡检主要内容" prop="taskContent"> |
|
|
|
|
<el-input placeholder="请输入巡检主要内容" type="textarea" readonly v-model="inspectionForm.taskContent" rea></el-input> |
|
|
|
|
<el-input placeholder="请输入巡检主要内容" type="textarea" disabled v-model="inspectionForm.taskContent" style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="任务开始时间" prop="taskStartTime"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看'" style="width: 100%;" v-model="inspectionForm.taskStartTime" type="date" placeholder="请选择任务开始时间"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看' || dialogTitle == '巡检任务'" style="width: 98%;" v-model="inspectionForm.taskStartTime" type="date" placeholder="请选择任务开始时间"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="预约上门时间" prop="reservationTime"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看'" style="width: 100%;" v-model="inspectionForm.reservationTime" type="date" placeholder="请选择预约上门时间"> |
|
|
|
|
<el-date-picker :disabled="dialogType == '查看' || dialogTitle == '巡检任务'" style="width: 98%;" v-model="inspectionForm.reservationTime" type="date" placeholder="请选择预约上门时间"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
@ -275,7 +258,7 @@ |
|
|
|
|
巡检任务 |
|
|
|
|
</div> |
|
|
|
|
<el-form-item label="巡检楼层"> |
|
|
|
|
<div style="display: flex;"> |
|
|
|
|
<div style="display: flex; width: 98%;"> |
|
|
|
|
<div v-for="item in floorArr" :key="item" @click="clickFloor(item)" |
|
|
|
|
style="padding: 0px 15px;border: 1px solid #bbbbbb; height: 30px;display: flex;align-items: center;justify-content: center;margin-right: 10px;border-radius: 3px;cursor: pointer;" |
|
|
|
|
:style="{ background: item == activeFloorName ? '#3a62d7' : '', color: item == activeFloorName ? '#fff' : '', borderColor: item == activeFloorName ? '#3a62d7' : '#bbb' }"> |
|
|
|
|
@ -284,7 +267,15 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="巡检内容"> |
|
|
|
|
<el-table :row-key="getRowKeys" :span-method="objectSpanMethod" :data="inspectionForm.tableData && inspectionForm.tableData.filter(item => item.floorName == activeFloorName)" border style="width: 100%"> |
|
|
|
|
<div style="width: 98%;margin-bottom: 20px;display: flex;justify-content: space-between;"> |
|
|
|
|
<div style="display: flex;"> |
|
|
|
|
<el-input placeholder="请输入设备名称" v-model="deviceName" style="width: 200px;margin-right: 2%;"></el-input><el-button type="primary" @click="handleSearchDevice">搜索</el-button> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" @click="handleExportDevice">导出</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<el-table :row-key="getRowKeys" :span-method="objectSpanMethod" :data="inspectionForm.tableData && inspectionForm.tableData.filter(item => item.floorName == activeFloorName)" border style="width:98%"> |
|
|
|
|
<el-table-column prop="deptName" align="center" label="房间名称"></el-table-column> |
|
|
|
|
<el-table-column prop="deviceName" align="center" label="巡检设备"></el-table-column> |
|
|
|
|
<el-table-column prop="checkContent" align="center" label="巡检内容"></el-table-column> |
|
|
|
|
@ -299,6 +290,7 @@ |
|
|
|
|
<el-table-column prop="imgs" align="center" label="现场照片"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-upload |
|
|
|
|
list-type="picture-card" |
|
|
|
|
v-show="dialogTitle != '巡检确认'" |
|
|
|
|
:disabled="dialogTitle == '巡检确认'" |
|
|
|
|
class="upload-demo" |
|
|
|
|
@ -310,12 +302,12 @@ |
|
|
|
|
:on-exceed="handleExceed" |
|
|
|
|
:file-list="scope.row.fileList" |
|
|
|
|
> |
|
|
|
|
<el-button size="small" type="text">上传</el-button> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
</el-upload> |
|
|
|
|
<img @click="clickImg(scope.row.picUrl)" style="width: 200px;height: 200px;cursor: pointer;" :src="scope.row.picUrl" alt="" v-show="dialogTitle == '巡检确认' && scope.row.picUrl != ''"> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="signUrl" align="center" label="使用人签字"> |
|
|
|
|
<!-- <el-table-column prop="signUrl" align="center" label="使用人签字"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入使用人签字" v-model="scope.row.signUrl" :disabled="dialogTitle == '巡检确认'"></el-input> |
|
|
|
|
</template> |
|
|
|
|
@ -324,9 +316,15 @@ |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input placeholder="请输入备注" type="textarea" v-model="scope.row.remark" :disabled="dialogTitle == '巡检确认'"></el-input> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
</el-table> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="使用人签字" prop="signUrl"> |
|
|
|
|
<el-input placeholder="请输入使用人签字" v-model="inspectionForm.signUrl" :disabled="dialogTitle == '巡检确认'" style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
|
<el-input placeholder="请输入备注" type="textarea" v-model="inspectionForm.remark" :disabled="dialogTitle == '巡检确认'" style="width: 98%;"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div v-show="inspectionForm.taskStatus == 3"> <!-- --> |
|
|
|
|
<div |
|
|
|
|
@ -443,17 +441,20 @@ |
|
|
|
|
import {getDeepData} from '@/api/labManagement/inspectionManagement' |
|
|
|
|
import {getRepairPeople} from '@/api/operation/hand' |
|
|
|
|
import {getTaskPage,getDetail,taskSupervisorConfirm,taskServicemanReceive,updateTime,taskCreat,servicemanUpdateDetail,servicemanSubmit, |
|
|
|
|
customerConfirm,customerRefuse |
|
|
|
|
customerConfirm,customerRefuse,updateSign,exportDevice |
|
|
|
|
} from '@/api/labManagement/task' |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import {getDeviceList} from '@/api/device/device' |
|
|
|
|
import routingInspection from '@/views/components/routingInspection.vue' |
|
|
|
|
import {exportBlob,exportBlob1} from "@/api/common"; |
|
|
|
|
import { downloadXls } from "@/util/util"; |
|
|
|
|
export default { |
|
|
|
|
components:{ |
|
|
|
|
routingInspection |
|
|
|
|
}, |
|
|
|
|
data(){ |
|
|
|
|
return{ |
|
|
|
|
deviceName:'', |
|
|
|
|
htmlTitle:'巡检任务报告', |
|
|
|
|
routingForm:{}, |
|
|
|
|
inspectionForm:{ |
|
|
|
|
@ -586,7 +587,8 @@ |
|
|
|
|
dialogerror:false, //巡检异常弹窗 |
|
|
|
|
errorForm:{}, |
|
|
|
|
role_id:'', |
|
|
|
|
tableData:[] |
|
|
|
|
tableData:[], |
|
|
|
|
inspectionTable:[] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed:{ |
|
|
|
|
@ -629,6 +631,23 @@ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
methods:{ |
|
|
|
|
// 搜索设备 |
|
|
|
|
handleSearchDevice(){ |
|
|
|
|
this.inspectionForm.tableData = this.inspectionTable |
|
|
|
|
if(this.inspectionForm.tableData.length != 0){ |
|
|
|
|
let arr = this.inspectionForm.tableData && this.inspectionForm.tableData.filter(item => item.floorName == this.activeFloorName) |
|
|
|
|
let arr1 = arr.filter(item => item.deviceName.indexOf(this.deviceName) != -1) |
|
|
|
|
console.log('arr1',arr1) |
|
|
|
|
this.inspectionForm.tableData = arr1 |
|
|
|
|
this.$forceUpdate() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 导出设备 |
|
|
|
|
handleExportDevice(){ |
|
|
|
|
exportBlob1(`/api/lab-ops/maintenance/task-detail-configuration`,{id:this.inspectionForm.id}).then(res => { |
|
|
|
|
downloadXls(res.data, "物资数据模板.xlsx"); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 点击图片 |
|
|
|
|
clickImg(url){ |
|
|
|
|
this.imgUrl = url |
|
|
|
|
@ -721,6 +740,8 @@ |
|
|
|
|
}, |
|
|
|
|
clickFloor(val){ |
|
|
|
|
console.log('val----------->',val) |
|
|
|
|
this.inspectionForm.tableData = this.inspectionTable |
|
|
|
|
this.deviceName = '' |
|
|
|
|
// this.activeFloor = val.value |
|
|
|
|
this.activeFloorName = val |
|
|
|
|
let firstFloor = this.addForm.details.find(item => item.floorName == this.activeFloorName) |
|
|
|
|
@ -997,51 +1018,23 @@ |
|
|
|
|
}, |
|
|
|
|
handleInspection(row){ |
|
|
|
|
this.dialogTitle = '巡检任务' |
|
|
|
|
// this.inspectionForm = row |
|
|
|
|
// console.log('tableData==================>',this.inspectionForm.tableData) |
|
|
|
|
|
|
|
|
|
// this.inspectionForm.tableData = this.mergeTableRow(this.inspectionForm.tableData,this.activeFloor,['deptName']) |
|
|
|
|
this.inspectionRules = { |
|
|
|
|
signUrl:{required:true,message:'请输入签名',trigger:'blur'} |
|
|
|
|
} |
|
|
|
|
getDetail({id:row.id}).then(res =>{ |
|
|
|
|
this.inspectionForm = res.data.data |
|
|
|
|
this.dialogInspection = true |
|
|
|
|
this.inspectionForm.tableData = this.checkDeepData(res.data.data.details) |
|
|
|
|
this.inspectionTable = JSON.parse(JSON.stringify(this.inspectionForm.tableData)) |
|
|
|
|
this.inspectionForm.tableData.map(item =>{ |
|
|
|
|
if(item.picUrl != ''){ |
|
|
|
|
item.fileList = [{name:'巡检图片.png',link:item.picUrl}] |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// getDeepData({parentId:res.data.data.deptId}).then(result =>{ |
|
|
|
|
// this.floorArr = [] |
|
|
|
|
// result.data.data.map(item =>{ |
|
|
|
|
// this.floorArr.push({ |
|
|
|
|
// value:item.id, |
|
|
|
|
// name:item.deptName, |
|
|
|
|
// checked:false |
|
|
|
|
// }) |
|
|
|
|
// this.activeFloor = result.data.data[0].id |
|
|
|
|
// this.activeFloorName = result.data.data[0].deptName |
|
|
|
|
// getDeepData({parentId:this.activeFloor}).then(result1 =>{ |
|
|
|
|
// this.roomArr = [] |
|
|
|
|
// result1.data.data.map(item =>{ |
|
|
|
|
// this.roomArr.push({ |
|
|
|
|
// value:item.id, |
|
|
|
|
// name:item.deptName, |
|
|
|
|
// checked:false |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// this.activeRoom = result1.data.data[0].id |
|
|
|
|
// this.activeRoomName = result1.data.data[0].deptName |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// console.log('floor=========>',this.floorArr) |
|
|
|
|
// console.log('details========>',res.data.data.details) |
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
this.floorArr = this.inspectionForm.details.map(item => item.floorName) |
|
|
|
|
this.activeFloorName = this.floorArr[0] |
|
|
|
|
|
|
|
|
|
console.log('activeFloorName==========>',this.activeFloorName) |
|
|
|
|
// this.inspectionForm.tableData = this.mergeTableRow(this.inspectionForm.tableData,this.activeFloorName,['deptName']) |
|
|
|
|
console.log('tableData------->',this.inspectionForm.tableData) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
@ -1185,26 +1178,44 @@ |
|
|
|
|
craft:item.craft, |
|
|
|
|
period:item.period, |
|
|
|
|
picUrl:item.picUrl, |
|
|
|
|
signUrl:item.signUrl, |
|
|
|
|
remark:item.remark, |
|
|
|
|
// signUrl:item.signUrl, |
|
|
|
|
// remark:item.remark, |
|
|
|
|
id:item.id, |
|
|
|
|
status:item.status |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
if(query.find(item => item.status === '') || query.find(item => item.signUrl == '')){ |
|
|
|
|
if(query.find(item => item.status === '')){ |
|
|
|
|
this.$message.error('状态及使用人签名请填写完整') |
|
|
|
|
}else{ |
|
|
|
|
this.$confirm('请确认是否巡检完成?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
servicemanUpdateDetail(query).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
servicemanSubmit({id:this.inspectionForm.id}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
updateSign({ |
|
|
|
|
signUrl:this.inspectionForm.signUrl, |
|
|
|
|
remark:this.inspectionForm.remark, |
|
|
|
|
id:this.inspectionForm.id |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('提交成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
this.dialogInspection = false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}).catch(() =>{ |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|