修改页面,添加设备导出功能

master
jinna 1 year ago
parent 652a883198
commit 21c92f7c4b
  1. 9
      src/api/common.js
  2. 17
      src/api/labManagement/task.js
  3. 25
      src/assets/json/status.json
  4. 8
      src/page/index/top/index.vue
  5. 17
      src/page/index/top/top-notice.vue
  6. 1
      src/store/getters.js
  7. 6
      src/store/modules/common.js
  8. 191
      src/views/businessManagement/inspection/task.vue
  9. 95
      src/views/businessManagement/ordinary.vue
  10. 21
      src/views/desk/message.vue
  11. 560
      src/views/labManagement/components/addDialog.vue
  12. 41
      src/views/operation/hand.vue

@ -13,3 +13,12 @@ export const exportBlob = (url, params) => {
responseType: 'blob'
})
}
export const exportBlob1 = (url, params) => {
return request({
url: url,
params: params,
method: 'post',
responseType: 'blob'
})
}

@ -95,3 +95,20 @@ export const customerRefuse = (data) =>{
})
}
export const updateSign = (data) =>{
return request({
url:'/api/lab-ops/maintenance/task-serviceman-update-sign',
method:'post',
data
})
}
// 设备导出
export const exportDevice = (query) =>{
return request({
url:'/api/lab-ops/maintenance/task-detail-configuration',
method:'post',
params:query
})
}

@ -84,6 +84,12 @@
"status": 102,
"color": "#f56c6c",
"type": "danger"
},
{
"name": "待评价",
"status": 20,
"color": "#67c23a",
"type": "success"
}
],
"1123598816738675201": [
@ -170,6 +176,12 @@
"status": 102,
"color": "#f56c6c",
"type": "danger"
},
{
"name": "维修完成",
"status": 20,
"color": "#67c23a",
"type": "success"
}
],
"1839536982874193922": [
@ -250,6 +262,12 @@
"status": 102,
"color": "#f56c6c",
"type": "danger"
},
{
"name": "维修完成",
"status": 20,
"color": "#67c23a",
"type": "success"
}
],
"1839537055389515777": [
@ -318,8 +336,13 @@
"status": 102,
"color": "#f56c6c",
"type": "danger"
},
{
"name": "维修完成",
"status": 20,
"color": "#67c23a",
"type": "success"
}
],
"1839552581620793346": [
{

@ -179,12 +179,12 @@
}],
},
]
}
},
value:''
};
},
filters: {},
created() {
},
created() {},
mounted() {
listenfullscreen(this.setScreen);
},
@ -207,7 +207,7 @@
"isCollapse",
"tag",
"logsLen",
"logsFlag"
"logsFlag",
])
},
methods: {

@ -1,6 +1,6 @@
<template>
<div slot="reference" @click="clickNotice">
<el-badge :value="total" class="item">
<el-badge :value="messageTotal" class="item">
<i class="el-icon-bell"></i>
</el-badge>
</div>
@ -8,7 +8,8 @@
<script>
import {messTotal} from '@/api/desk/message'
export default {
import {mapGetters, mapState} from "vuex";
export default {
name: "top-notice",
data () {
return {
@ -25,8 +26,16 @@ export default {
total:0
}
},
computed: {
...mapState({
messageTotal: state => state.common.messageTotal,
}),
},
created () {
this.getTotal()
if(!this.messageTotal){
this.getTotal()
}
},
methods: {
clickNotice(){
@ -36,7 +45,7 @@ export default {
},
getTotal(){
messTotal().then(res =>{
this.total = res.data.data
this.$store.commit("SET_MESSAGETOTAL", res.data.data);
})
}
}

@ -25,5 +25,6 @@ const getters = {
logsLen: state => state.logs.logsList.length || 0,
logsFlag: (state, getters) => getters.logsLen === 0,
flowRoutes: state => state.dict.flowRoutes,
messageTotal: state => state.dict.messageTotal,
}
export default getters

@ -28,8 +28,14 @@ const common = {
themeName: getStore({name: 'themeName'}) || 'theme-hey',
lockPasswd: getStore({name: 'lockPasswd'}) || '',
website: website,
messageTotal:null,
},
mutations: {
SET_MESSAGETOTAL: (state, active) => {
console.log('state',state)
console.log('active',active)
state.messageTotal = active;
},
SET_LANGUAGE: (state, language) => {
state.language = language
setStore({

@ -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,55 +116,38 @@
<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="专业名称">
<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="巡检周期">
<el-table-column prop="startTime" 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>
{{ 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>
<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{
servicemanUpdateDetail(query).then(res =>{
if(res.data.code == 200){
servicemanSubmit({id:this.inspectionForm.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('提交成功')
this.onLoad()
this.dialogInspection = false
}
})
}
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(() =>{
})
}
}

@ -478,6 +478,101 @@
v-model="repairForm.approveRemark"></el-input>
</el-form-item>
</div>
<div v-show="repairForm.status == 7 || repairForm.status == 8 || repairForm.status == 9">
<div style="
color: #101010;
font-size: 20px;
font-weight: 550;
margin-bottom: 20px;
">
评价
</div>
<div>
<p>1.您对本次维修的质量方面满意吗</p>
<div style="display:flex;">
<div style="width: 150px;
border-radius: 5px;
height: 30px;
text-align: center;
line-height: 30px;
margin-right: 20px;
cursor:pointer;"
:style="{ background: repairForm.isOkQuality == '1' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkQuality == '1' ? '#3a62d7' : '#4f4f4f' }"
>满意</div>
<div style="width: 150px;
border-radius: 5px;
height: 30px;
background: rgb(239, 239, 239);
text-align: center;
line-height: 30px;
margin-right: 20px;cursor:pointer;"
:style="{ background: repairForm.isOkQuality == '0' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkQuality == '0' ? '#3a62d7' : '#4f4f4f' }"
>不满意</div>
</div>
</div>
<div>
<p>2.您对本次维修的安全方面满意吗</p>
<div style="display:flex;">
<div style="width: 150px;
border-radius: 5px;
height: 30px;
background: rgb(239, 239, 239);
text-align: center;
line-height: 30px;
margin-right: 20px;cursor:pointer;"
:style="{ background: repairForm.isOkSecure == '1' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkSecure == '1' ? '#3a62d7' : '#4f4f4f' }"
>满意</div>
<div style="width: 150px;
border-radius: 5px;
height: 30px;
background: rgb(239, 239, 239);
text-align: center;
line-height: 30px;
margin-right: 20px;cursor:pointer;"
:style="{ background: repairForm.isOkSecure == '0' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkSecure == '0' ? '#3a62d7' : '#4f4f4f' }"
>不满意</div>
</div>
</div>
<div>
<p>3.您对本次维修的时效方面满意吗</p>
<div style="display:flex;margin-bottom:30px;">
<div style="width: 150px;
border-radius: 5px;
height: 30px;
background: rgb(239, 239, 239);
text-align: center;
line-height: 30px;
margin-right: 20px;cursor:pointer;"
:style="{ background: repairForm.isOkValidity == '1' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkValidity == '1' ? '#3a62d7' : '#4f4f4f' }"
>满意</div>
<div style="width: 150px;
border-radius: 5px;
height: 30px;
background: rgb(239, 239, 239);
text-align: center;
line-height: 30px;
margin-right: 20px;cursor:pointer;"
:style="{ background: repairForm.isOkValidity == '0' ? '#3a62d733' : 'rgb(239, 239, 239)', color: repairForm.isOkValidity == '0' ? '#3a62d7' : '#4f4f4f' }"
>不满意</div>
</div>
</div>
</div>
<div v-show="repairForm.status == 7 || repairForm.status == 8 || repairForm.status == 9">
<div style="
color: #101010;
font-size: 20px;
font-weight: 550;
margin-bottom: 20px;
">
签名
</div>
<div v-show="repairForm.status == 7 || repairForm.status == 8 || repairForm.status == 9">
<img :src="repairForm.signatureUrl" alt="">
</div>
<el-form-item label="签名人" prop="signaturePerson">
<el-input disabled placeholder="请输入签名人" v-model="repairForm.signaturePerson" style="width:99%"></el-input>
</el-form-item>
</div>
</el-form>
<span slot="footer" class="dialog-footer">
<!-- <el-button v-show="dialogType != 'view'" @click="handleSaveRepair"> </el-button> -->

@ -32,7 +32,7 @@
</el-button>
</template>
<template slot="menu" slot-scope="{ row }">
<el-button size="small" @click="handleRead(row)"> </el-button>
<el-button size="small" :disabled="row.status == 1" @click="handleRead(row)"> </el-button>
</template>
<template slot-scope="{row}"
slot="category">
@ -140,7 +140,7 @@
};
},
computed: {
...mapGetters(["permission"]),
...mapGetters(["permission",'messageTotal']),
permissionList() {
return {
addBtn: this.vaildData(this.permission.notice_add, false),
@ -219,9 +219,9 @@
this.$refs.crud.toggleSelection();
},
handleRead(row){
if(row.status == 1){
this.$message.warning('当前消息状态已读,请选择未读的消息')
}else{
// if(row.status == 1){
// this.$message.warning('')
// }else{
this.$confirm("确定将选择数据已读?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -233,18 +233,25 @@
}).then(res =>{
if(res.data.code == 200){
this.$message.success('操作成功!')
this.onLoad(this.page)
this.onLoad(this.page)
this.getTotal()
}
})
}).catch(() =>{
})
}
// }
},
getTotal(){
messTotal().then(res =>{
this.$store.commit("SET_MESSAGETOTAL", res.data.data);
})
},
handleSuccess(){
overAll().then(res =>{
if(res.data.code == 200){
this.$message.success('操作成功')
this.getTotal()
}
})
},

@ -6,7 +6,8 @@
<div style="color: #101010;font-size: 20px;font-weight: 550;margin-bottom: 20px;">基本信息</div>
<el-form-item label="单位名称" prop="unitId" v-if="title == '新建'">
<el-select style="width:98%" placeholder="请选择单位名称" v-model="addForm.unitId" @change="changeUnit">
<el-option v-for="item in unitData" :key="item.id" :label="item.title" :value="item.id"></el-option>
<el-option v-for="item in unitData" :key="item.id" :label="item.title"
:value="item.id"></el-option>
<!-- <el-option label="畜牧局实验室" value="2"></el-option> -->
</el-select>
</el-form-item>
@ -17,8 +18,8 @@
<div>
<div style="color: #101010;font-size: 20px;font-weight: 550;margin-bottom: 20px;">巡检内容</div>
<el-form-item label="巡检标题" prop="content">
<el-input style="width: 98%;" type="textarea" v-model="addForm.content"
placeholder="请输入巡检标题" :disabled="title == '查看'"></el-input>
<el-input style="width: 98%;" type="textarea" v-model="addForm.content" placeholder="请输入巡检标题"
:disabled="title == '查看'"></el-input>
</el-form-item>
<el-form-item label="楼层">
<div style="display: flex;">
@ -39,8 +40,9 @@
</div>
</el-form-item>
<el-form-item label="巡检配置">
<el-table :data="addForm.tableData" border style="width: 100%" :span-method="objectSpanMethod" v-loading="isLoad">
<el-table-column width="50" align="center" >
<el-table :data="addForm.tableData" border style="width: 100%" :span-method="objectSpanMethod"
v-loading="isLoad">
<el-table-column width="50" align="center">
<template slot="header" slot-scope="scope">
<div @click="addColumn()"
style="width:30px;height: 30px;background: #409eff;border-radius: 50%;cursor: pointer;display: flex;align-items: center;justify-content: center;">
@ -56,14 +58,17 @@
</el-table-column>
<el-table-column prop="deviceId" align="center" label="设备">
<template slot-scope="scope">
<el-select placeholder="请选择设备" :disabled="title == '查看'" 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 placeholder="请选择设备" :disabled="title == '查看'" 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="请输入巡检内容" :disabled="title == '查看'" v-model="scope.row.checkContent"></el-input>
<el-input placeholder="请输入巡检内容" :disabled="title == '查看'"
v-model="scope.row.checkContent"></el-input>
</template>
</el-table-column>
<el-table-column prop="craft" align="center" label="工艺要求">
@ -77,50 +82,35 @@
<!-- <el-option label="日" value="001"></el-option>
<el-option label="月" value="002"></el-option>
<el-option label="年" value="003"></el-option> -->
<el-option v-for="item in periodArr" :key="item.dictKey" :label="item.dictValue" :value="parseInt(item.dictKey)"></el-option>
<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="开始时间">
<template slot-scope="scope">
<el-date-picker style="width: 100%;" v-model="scope.row.startTime" type="date" @change="((val) =>changeStartTime(val,scope.$index))"
placeholder="请选择开始时间" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :disabled="title == '查看'">
<el-date-picker style="width: 100%;" v-model="scope.row.startTime" type="date"
@change="((val) => changeStartTime(val, scope.$index))" placeholder="请选择开始时间"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" :disabled="title == '查看'">
</el-date-picker>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-form-item label="维保合同" prop="contractFile">
<el-upload
class="upload-demo"
action="/api/blade-resource/oss/endpoint/put-file"
:on-success="handleSuccess"
:on-remove="handleRemove"
:headers="headers"
multiple
:disabled="title == '查看'"
accept=".docx,.pdf,"
:limit="3"
:on-exceed="handleExceed"
<el-upload class="upload-demo" action="/api/blade-resource/oss/endpoint/put-file"
:on-success="handleSuccess" :on-remove="handleRemove" :headers="headers" multiple
:disabled="title == '查看'" accept=".docx,.pdf," :limit="3" :on-exceed="handleExceed"
:file-list="imgList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">支持上传docxpdf文件且不超过10M</div>
</el-upload>
</el-form-item>
<el-form-item label="实验室图纸" prop="drawingFile">
<el-upload
class="upload-demo"
action="/api/blade-resource/oss/endpoint/put-file"
:on-success="handledrawSuccess"
:on-remove="handledrawRemove"
:headers="headers"
multiple
list-type="picture-card"
:disabled="title == '查看'"
accept=".png,.jpeg,.jpg,"
:limit="3"
:on-exceed="handleExceed"
:file-list="drawList">
<el-upload class="upload-demo" action="/api/blade-resource/oss/endpoint/put-file"
:on-success="handledrawSuccess" :on-remove="handledrawRemove" :headers="headers" multiple
list-type="picture-card" :disabled="title == '查看'" accept=".png,.jpeg,.jpg," :limit="3"
:on-exceed="handleExceed" :file-list="drawList">
<i class="el-icon-plus"></i>
<!-- <el-button size="small" type="primary">点击上传</el-button> -->
<div slot="tip" class="el-upload__tip">支持上传pngjpegjpg文件且不超过10M</div>
@ -133,64 +123,65 @@
<script>
import website from '@/config/website';
import {getToken, removeToken, removeRefreshToken} from '@/util/auth';
import {getDeepData,getDeviceLists} from '@/api/labManagement/inspectionManagement'
import {getDeviceList,getDetail} from '@/api/device/device'
import {getChildList} from '@/api/system/dictbiz'
import { getToken, removeToken, removeRefreshToken } from '@/util/auth';
import { getDeepData, getDeviceLists } from '@/api/labManagement/inspectionManagement'
import { getDeviceList, getDetail } from '@/api/device/device'
import { getChildList } from '@/api/system/dictbiz'
import func from "@/util/func";
export default {
name: 'addDialog',
props:{
unitData:Array,
detailForm:Object,
title:String
props: {
unitData: Array,
detailForm: Object,
title: String
},
data() {
return {
isLoad:false,
isLoad: false,
addForm: {
tableData:[]
tableData: []
},
addRules:{
unitId:{required:true,message:'请选择单位',trigger:'blur'},
content:{required:true,message:'请输入巡检内容',trigger:'blur'}
addRules: {
unitId: { required: true, message: '请选择单位', trigger: 'blur' },
content: { required: true, message: '请输入巡检内容', trigger: 'blur' }
},
filesList:[],
drawList:[],
drawfiles:[],
imgList:[],
periodArr:[],
floorArr:[],
activeFloor:'',
roomArr:[],
activeRoom:'',
tableData:[],
deviceCurrent:1,
deviceSize:100,
deviceList:[],
spanArr:[],
pos:0,
currentIndex:0,
headers:{},
labId:''
filesList: [],
drawList: [],
drawfiles: [],
imgList: [],
periodArr: [],
floorArr: [],
activeFloor: '',
roomArr: [],
activeRoom: '',
tableData: [],
deviceCurrent: 1,
deviceSize: 100,
deviceList: [],
spanArr: [],
pos: 0,
currentIndex: 0,
headers: {},
labId: ''
}
},
watch:{
detailForm(newVal, oldVal){
if(JSON.stringify(newVal) != '{}'){
watch: {
detailForm(newVal, oldVal) {
if (JSON.stringify(newVal) != '{}') {
this.deviceList = []
this.detailForm = newVal
this.addForm = {
...this.detailForm,
unitId:newVal.deptId,
unitName:newVal.deptName,
content:newVal.planContent,
unitId: newVal.deptId,
unitName: newVal.deptName,
content: newVal.planContent,
}
this.floorArr = []
this.roomArr = []
if(newVal.details && newVal.details.length != 0){
this.tableData = this.getDeepCode(newVal.details,[])
this.tableData.map(item =>{
if (newVal.details && newVal.details.length != 0) {
this.tableData = this.getDeepCode(newVal.details, [])
this.tableData.map(item => {
item.period = item.period
})
this.changeUnit(newVal.deptId)
@ -201,80 +192,82 @@ export default {
this.drawfiles = []
this.filesList = this.detailForm.attaches
this.imgList = this.detailForm.attaches
this.detailForm.draws.map(item =>{
this.detailForm.draws.map(item => {
this.drawList.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
this.drawfiles.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
})
}else{
} else {
this.deviceList = []
this.imgList = []
this.filesList = []
this.drawList = []
this.drawfiles = []
this.getDeviceData()
getChildList(1,100,'1858710780677984257').then(res =>{
// this.getDeviceData()
getChildList(1, 100, '1858710780677984257').then(res => {
this.periodArr = res.data.data
})
this.headers = {
"Authorization":`Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
'Blade-Auth':'bearer ' + getToken(),
'Blade-Requested-With':'BladeHttpRequest'
"Authorization": `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
'Blade-Auth': 'bearer ' + getToken(),
'Blade-Requested-With': 'BladeHttpRequest'
}
}
}
},
created(){
this.getDeviceData()
getChildList(1,100,'1858710780677984257').then(res =>{
created() {
this.deviceList = []
// this.getDeviceData()
getChildList(1, 100, '1858710780677984257').then(res => {
this.periodArr = res.data.data
})
this.headers = {
"Authorization":`Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
'Blade-Auth':'bearer ' + getToken(),
'Blade-Requested-With':'BladeHttpRequest'
"Authorization": `Basic ${Base64.encode(`${website.clientId}:${website.clientSecret}`)}`,
'Blade-Auth': 'bearer ' + getToken(),
'Blade-Requested-With': 'BladeHttpRequest'
}
this.imgList = []
this.filesList = []
this.drawList = []
this.drawfiles = []
if(JSON.stringify(this.detailForm) != '{}'){
if (JSON.stringify(this.detailForm) != '{}') {
this.addForm = {
...this.detailForm,
unitId:this.detailForm.deptId,
unitName:this.detailForm.deptName,
content:this.detailForm.planContent,
unitId: this.detailForm.deptId,
unitName: this.detailForm.deptName,
content: this.detailForm.planContent,
}
this.floorArr = []
this.roomArr = []
this.tableData = this.getDeepCode(this.detailForm.details,[])
this.tableData = this.getDeepCode(this.detailForm.details, [])
this.changeUnit(this.detailForm.deptId)
this.detailForm.attaches.map(item =>{
this.detailForm.attaches.map(item => {
this.imgList.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
this.filesList.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
})
this.detailForm.draws.map(item =>{
this.detailForm.draws.map(item => {
this.drawList.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
this.drawfiles.push({
name:item.name,
url:item.link
name: item.name,
url: item.link
})
})
}else{
} else {
this.drawList = []
this.drawfiles = []
this.imgList = []
@ -282,43 +275,43 @@ export default {
this.addForm = {}
}
},
methods:{
getDeepCode(data,arr){
data.map(item =>{
if(item.details.length != 0){
this.getDeepCode(item.details,arr)
}else{
methods: {
getDeepCode(data, arr) {
data.map(item => {
if (item.details.length != 0) {
this.getDeepCode(item.details, arr)
} else {
arr.push(item)
}
})
return arr
},
handleSuccess(response, file, fileList){
if(response.code == 200){
handleSuccess(response, file, fileList) {
if (response.code == 200) {
this.filesList.push({
url:response.data.link, //url
name:response.data.originalName, //
url: response.data.link, //url
name: response.data.originalName, //
})
}
},
handleRemove(res,file){
handleRemove(res, file) {
this.filesList = this.filesList.filter(item => item.link == res.url && item.name == res.name)
},
handledrawSuccess(response, file, fileList){
if(response.code == 200){
handledrawSuccess(response, file, fileList) {
if (response.code == 200) {
this.drawfiles.push({
url:response.data.link, //url
name:response.data.originalName, //
url: response.data.link, //url
name: response.data.originalName, //
})
}
},
handledrawRemove(res,file){
handledrawRemove(res, file) {
this.drawfiles = this.drawfiles.filter(item => item.link == res.url && item.name == res.name)
},
getDeviceData(){
getDeviceList({current:this.deviceCurrent,size:this.deviceSize}).then(res =>{
getDeviceData() {
getDeviceList({ current: this.deviceCurrent, size: this.deviceSize }).then(res => {
this.deviceList = res.data.data.records
this.deviceList.forEach(item =>{
this.deviceList.forEach(item => {
item.disabled = false
})
})
@ -350,7 +343,7 @@ export default {
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 1 && row.deviceId != '') {
if(this.spanArr.length != 0){
if (this.spanArr.length != 0) {
const _row = this.spanArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
@ -361,143 +354,145 @@ export default {
}
},
//
changeStartTime(val,index){
changeStartTime(val, index) {
this.addForm.tableData[index].nextStartTime = val
},
//
changeDevice(val,index){
console.log('val------------->',val,index)
getDetail({id:val}).then(res =>{
if(this.title == '新建'){
console.log('tmp------------------->',this.tableData.find(item => item.deviceId == val))
changeDevice(val, index) {
console.log('val------------->', val, index)
getDetail({ id: val }).then(res => {
if (this.title == '新建') {
console.log('tmp------------------->', this.tableData.find(item => item.deviceId == val))
let arr = []
res.data.data.maintenances.map(item =>{
res.data.data.maintenances.map(item => {
arr.push({
floorId:this.activeFloor, // id
floorName:this.floorArr.find(item => item.id == this.activeFloor).deptName, //
deviceId:item.deviceId,
deviceName:res.data.data.name,
deptId:this.activeRoom, // id
deptName:this.roomArr.find(item => item.id == this.activeRoom).deptName, //
checkContent:item.checkContent,
majorName:'',
nextStartTime:item.startTime,
startTime:item.startTime,
craft:item.craft,
period:item.period,
floorId: this.activeFloor, // id
floorName: this.floorArr.find(item => item.id == this.activeFloor).deptName, //
deviceId: item.deviceId,
deviceName: res.data.data.name,
deptId: this.activeRoom, // id
deptName: this.roomArr.find(item => item.id == this.activeRoom).deptName, //
checkContent: item.checkContent,
majorName: '',
nextStartTime: item.startTime,
startTime: item.startTime,
craft: item.craft,
period: item.period,
})
})
this.tableData = [...this.tableData,...arr]
this.tableData = [...this.tableData, ...arr]
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
this.deviceList.map(item1 =>{
this.deviceList.map(item1 => {
item1.disabled = false
arr1.map(item2 =>{
if(item2.id == item1.id){
arr1.map(item2 => {
if (item2.id == item1.id) {
item1.disabled = true
}
})
})
}else{
let arr = []
res.data.data.maintenances.map(item =>{
arr.push({
floorId:this.activeFloor, // id
floorName:this.floorArr.find(item => item.id == this.activeFloor).deptName, //
deviceId:item.deviceId,
deviceName:res.data.data.name,
deptId:this.activeRoom, // id
deptName:this.roomArr.find(item => item.id == this.activeRoom).deptName, //
checkContent:item.checkContent,
majorName:'',
nextStartTime:item.startTime,
startTime:item.startTime,
craft:item.craft,
period:item.period,
} else {
let arr = []
res.data.data.maintenances.map(item => {
arr.push({
floorId: this.activeFloor, // id
floorName: this.floorArr.find(item => item.id == this.activeFloor).deptName, //
deviceId: item.deviceId,
deviceName: res.data.data.name,
deptId: this.activeRoom, // id
deptName: this.roomArr.find(item => item.id == this.activeRoom).deptName, //
checkContent: item.checkContent,
majorName: '',
nextStartTime: item.startTime,
startTime: item.startTime,
craft: item.craft,
period: item.period,
})
})
})
if(index == this.addForm.tableData.length - 1){
this.addForm.tableData.splice(index,1,...arr)
// this.tableData.splice(index,1,...arr)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
}else{
this.addForm.tableData.splice(index,this.spanArr[index],...arr)
// this.tableData.splice(index,this.spanArr[index],...arr)
if (index == this.addForm.tableData.length - 1) {
this.addForm.tableData.splice(index, 1, ...arr)
// this.tableData.splice(index,1,...arr)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
} else {
this.addForm.tableData.splice(index, this.spanArr[index], ...arr)
// this.tableData.splice(index,this.spanArr[index],...arr)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
}
this.addForm.tableData = func.process(this.addForm.tableData)
this.$forceUpdate()
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
}
this.addForm.tableData = func.process(this.addForm.tableData)
this.$forceUpdate()
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
this.tableData = [...this.tableData,...this.addForm.tableData]
this.tableData = func.process(this.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
console.log('arr1==============>',arr1)
this.deviceList.map(item1 =>{
item1.disabled = false
arr1.map(item2 =>{
if(item2.id == item1.id){
item1.disabled = true
}
this.tableData = [...this.tableData, ...this.addForm.tableData]
this.tableData = func.process(this.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
console.log('arr1==============>', arr1)
this.deviceList.map(item1 => {
item1.disabled = false
arr1.map(item2 => {
if (item2.id == item1.id) {
item1.disabled = true
}
})
})
})
}
console.log('this.deviceList', this.deviceList)
}
})
},
//
changeUnit(val){
console.log('val===========>',val)
console.log('unitData===============>',this.unitData)
changeUnit(val) {
console.log('val===========>', val)
console.log('unitData===============>', this.unitData)
this.labId = val
if(this.title == '新建'){
if (this.title == '新建') {
this.addForm.unitName = this.unitData.find(item => item.id == val).title
this.deviceList.map(item =>{
this.deviceList.map(item => {
item.disabled = false
})
}
getDeepData({parentId:val}).then(res =>{
console.log('res ------------------->',res)
getDeepData({ parentId: val }).then(res => {
console.log('res ------------------->', res)
this.floorArr = res.data.data
this.activeFloor = res.data.data.length > 0 ? res.data.data[0].id : ''
getDeepData({parentId:this.activeFloor}).then(res =>{
getDeepData({ parentId: this.activeFloor }).then(res => {
this.roomArr = res.data.data
this.activeRoom = res.data.data.length > 0 ? res.data.data[0].id : ''
this.clickRoom(res.data.data[0])
if(JSON.stringify(this.detailForm) != '{}'){
console.log(this.activeFloor,this.activeRoom)
if (JSON.stringify(this.detailForm) != '{}') {
console.log(this.activeFloor, this.activeRoom)
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom)
console.log('addForm==========>',this.addForm.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
console.log('addForm==========>', this.addForm.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
console.log('arr1==============>',arr1)
this.deviceList.map(item1 =>{
console.log('arr1==============>', arr1)
this.deviceList.map(item1 => {
item1.disabled = false
arr1.map(item2 =>{
if(item2.id == item1.id){
arr1.map(item2 => {
if (item2.id == item1.id) {
item1.disabled = true
}
})
})
console.log('deviceList', this.deviceList)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
@ -505,62 +500,63 @@ export default {
})
})
},
openForm(){
openForm() {
this.addForm.tableData = [
{floorId:this.activeFloor,roomId:this.activeRoom,majorName:'',checkContent:'',craft:''},
{ floorId: this.activeFloor, roomId: this.activeRoom, majorName: '', checkContent: '', craft: '' },
]
this.tableData = this.tableData.concat(this.addForm.tableData)
this.activeFloor = '001'
this.activeRoom = '001'
},
clearForm(){
clearForm() {
this.$refs['form'].resetFields()
this.tableData = []
this.addForm = {
tableData : []
tableData: []
}
},
addColumn() {
if(this.title == '查看'){
if (this.title == '查看') {
return
}else{
this.addForm.tableData.push({floorId:this.activeFloor,roomId:this.activeRoom,majorName:'',checkContent:'',craft:'',deviceId:''})
} else {
this.addForm.tableData.push({ floorId: this.activeFloor, roomId: this.activeRoom, majorName: '', checkContent: '', craft: '', deviceId: '' })
this.tableData = this.tableData.filter(item => (item.floorId != this.activeFloor || item.roomId != this.activeRoom))
}
},
deleteColumn(row, index) {
if(this.title == '查看'){
deleteColumn(row, index) {
if (this.title == '查看') {
return
}else{
} else {
this.tableData.splice(index, 1);
this.spanArr = []
this.pos = 0
this.addForm.tableData.splice(index, 1);
this.getSpanArr(this.addForm.tableData)
console.log('tableData',this.tableData)
}
},
dealFloor(val){
getDeepData({parentId:val}).then(res =>{
},
dealFloor(val) {
getDeepData({ parentId: val }).then(res => {
this.roomArr = res.data.data
this.activeRoom = this.roomArr[0].id
this.clickRoom(this.roomArr[0])
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom)
if(this.addForm.tableData.length == 0){
this.addForm.tableData = [{floorId:this.activeFloor,roomId:this.activeRoom,majorName:'',checkContent:'',craft:''}]
if (this.addForm.tableData.length == 0) {
this.addForm.tableData = [{ floorId: this.activeFloor, roomId: this.activeRoom, majorName: '', checkContent: '', craft: '' }]
}
const uniqueArr = this.addForm.tableData.filter((item, index, self) => {
return index === self.findIndex(obj => obj.craft === item.craft && obj.deviceId === item.deviceId);
});
this.addForm.tableData = uniqueArr
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
this.deviceList.map(item1 =>{
this.deviceList.map(item1 => {
item1.disabled = false
arr1.map(item2 =>{
if(item2.id == item1.id){
arr1.map(item2 => {
if (item2.id == item1.id) {
item1.disabled = true
}
})
@ -570,36 +566,36 @@ export default {
this.getSpanArr(this.addForm.tableData)
})
},
clickFloor(val){
clickFloor(val) {
this.activeFloor = val.id
this.dealFloor(val.id)
},
clickRoom(val){
clickRoom(val) {
this.activeRoom = val.id
console.log('val1------------->',val)
console.log('title------------->',this.title)
if(this.title == '新建'){
getDeviceLists({limsId:this.labId,floorId:this.activeFloor,roomId:this.activeRoom}).then(res =>{
console.log('val1------------->', val)
console.log('title------------->', this.title)
if (this.title == '新建') {
getDeviceLists({ limsId: this.labId, floorId: this.activeFloor, roomId: this.activeRoom }).then(res => {
this.deviceList = res.data.data
console.log('res==============>',res)
console.log('table-------------->',this.tableData)
res.data.data.map((item,index) =>{
if(!this.tableData.find(item => item.deptId == this.activeRoom)){
this.changeDevice(item.id,index)
}else{
console.log('res==============>', res)
console.log('table-------------->', this.tableData)
res.data.data.map((item, index) => {
if (!this.tableData.find(item => item.deptId == this.activeRoom)) {
this.changeDevice(item.id, index)
} else {
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom)
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
let arr1 = this.deviceList.filter(item1 =>
this.addForm.tableData.some(item2 =>
item1.id == item2.deviceId
)
);
this.deviceList.map(item1 =>{
this.deviceList.map(item1 => {
item1.disabled = false
arr1.map(item2 =>{
if(item2.id == item1.id){
arr1.map(item2 => {
if (item2.id == item1.id) {
item1.disabled = true
}
})
@ -607,35 +603,27 @@ export default {
}
})
})
}else{
} else {
this.isLoad = true
getDeviceLists({limsId:this.labId,floorId:this.activeFloor,roomId:this.activeRoom}).then(res =>{
getDeviceLists({ limsId: this.labId, floorId: this.activeFloor, roomId: this.activeRoom }).then(res => {
this.deviceList = res.data.data
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom)
this.$forceUpdate();
setTimeout(() =>{
setTimeout(() => {
this.isLoad = false
},200)
// if(this.addForm.tableData.length == 0){
// this.addForm.tableData = [{floorId:this.activeFloor,roomId:this.activeRoom,majorName:'',checkContent:'',craft:''}]
// }
// const uniqueArr = this.addForm.tableData.filter((item, index, self) => {
// return index === self.findIndex(obj => obj.craft === item.craft && obj.deviceId === item.deviceId);
// });
// this.addForm.tableData = uniqueArr
// let arr1 = this.deviceList.filter(item1 =>
// this.addForm.tableData.some(item2 =>
// item1.id == item2.deviceId
// )
// );
// this.deviceList.map(item1 =>{
// item1.disabled = false
// arr1.map(item2 =>{
// if(item2.id == item1.id){
// item1.disabled = true
// }
// })
// })
}, 200)
this.deviceList.map(item1 => {
item1.disabled = false
if(this.addForm.tableData.filter(item2 => item2.deviceId == item1.id).length == item1.maintenances.length){
item1.disabled = true
}
// arr1.map(item2 => {
// if (item2.id == item1.id) {
// item1.disabled = true
// }
// })
})
console.log('this.addForm.tableData',this.addForm.tableData)
this.$forceUpdate();
this.spanArr = []
this.pos = 0
this.getSpanArr(this.addForm.tableData)

@ -78,7 +78,7 @@
<el-button v-show="row.status == -1" @click="handleEdit(row)">编辑</el-button>
<el-button v-show="row.status == -1" @click="handleSubmit(row)">提交</el-button>
<el-button v-show="row.status == 4" @click="confirmOrder(row)">确认</el-button>
<el-button v-show="row.status == 6" @click="handleEvaluate(row)">评价</el-button>
<el-button v-show="row.status == 6 || row.status == 20" @click="handleEvaluate(row)">评价</el-button>
<el-button @click="handleExport(row)">导出</el-button>
<!-- <el-button v-show="row.status == 9" @click="clickPrint(row)">发票打印</el-button> -->
</template>
@ -129,19 +129,6 @@
<el-input placeholder="请输入设备名称" v-model="detailForm.deviceName" disabled style="width: 98%;"></el-input>
</el-form-item>
<el-form-item label="故障专业类型" prop="faultType" v-show="viewType == 'view'">
<!-- <el-select
placeholder="请选择故障专业类型"
disabled
v-model="detailForm.faultType"
style="width: 100%"
>
<el-option
v-for="item in errorList"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select> -->
<el-input placeholder="请输入故障专业类型" v-model="detailForm.faultType" disabled style="width: 98%;"></el-input>
</el-form-item>
@ -159,7 +146,20 @@
</el-date-picker>
</el-form-item>
</div>
<div v-show="rowStatus != 0">
<div v-show="rowStatus == 20">
<div style="
color: #101010;
font-size: 20px;
font-weight: 550;
margin-bottom: 20px;
">
处理情况
</div>
<el-form-item label="关闭原因">
<el-input type="textarea" v-model="detailForm.closeReason" disabled></el-input>
</el-form-item>
</div>
<div v-show="rowStatus != 0 && rowStatus != 20">
<div style="
color: #101010;
font-size: 20px;
@ -177,7 +177,7 @@
<el-input type="textarea" v-model="detailForm.customerOpinion" disabled style="width: 98%;"></el-input>
</el-form-item>
</div>
<div v-show="rowStatus != 0 && rowStatus != 1 && rowStatus != 2 && rowStatus != 3">
<div v-show="rowStatus != 0 && rowStatus != 20 && rowStatus != 1 && rowStatus != 2 && rowStatus != 3">
<div style="
color: #101010;
font-size: 20px;
@ -301,7 +301,7 @@
</el-form-item>
</div>
<div v-show="(rowStatus == 6 && detailForm.approveResult1 == 0)"></div>
<div v-show="(rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1">
<div v-show="((rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1) || (rowStatus == 20 || isEvalute) || rowStatus == 7 || rowStatus == 8 || rowStatus == 9">
<div style="
color: #101010;
font-size: 20px;
@ -380,7 +380,7 @@
</div>
</div>
</div>
<div v-show="(rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1">
<div v-show="((rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1) || (rowStatus == 20 || isEvalute) || rowStatus == 7 || rowStatus == 8 || rowStatus == 9">
<div style="
color: #101010;
font-size: 20px;
@ -389,12 +389,15 @@
">
签名
</div>
<div style="margin-bottom: 10px;cursor: pointer;" @click="clickAssign" v-show="nameImg == ''">
<div style="margin-bottom: 10px;cursor: pointer;" @click="clickAssign" v-show="nameImg == '' && rowStatus != 7 && rowStatus != 8 && rowStatus != 9">
<img src="@/assets/images/assign.png" alt="">
</div>
<div v-show="nameImg != ''" @click="clickAssign">
<img :src="nameImg" alt="">
</div>
<div v-show="detailForm.signatureUrl != '' && (rowStatus == 7 || rowStatus == 8 || rowStatus == 9)" @click="clickAssign">
<img :src="detailForm.signatureUrl" alt="">
</div>
<!-- <div v-show="isEvalute">
<avue-sign ref="sign"></avue-sign>
<el-button @click="clearName">清空</el-button>

Loading…
Cancel
Save